#42007 [NEW]: ctype_alnum( int ) will return false
| From: | adrian dot gheorghe at gmail dot com | Date: | Mon, 16 Jul 2007 10:54:07 +0000 |
| Subject: | #42007 [NEW]: ctype_alnum( int ) will return false | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-115107@lists.php.net to get a copy of this message | ||
From: adrian dot gheorghe at gmail dot com
Operating system: Windows XP Sp2
PHP version: 5.2.3
PHP Bug Type: Unknown/Other Function
Bug description: ctype_alnum( int ) will return false
Description:
------------
ctype_alnum returns false if you pass it an integer (ie 7). I know the
docs say that it should receive a string, as all ctype_* functions should,
but I believe it's pointless to have to do a ctype_alnum( '' . $var ) at
every call just to be sure. Also, the docs say that the function is
equivalent to preg_match('/^[a-z0-9]+$/iD', $text) and matching 7 against
that expression will work.
Reproduce code:
---------------
var_dump( ctype_alnum( 7 ) );
Expected result:
----------------
bool(true)
Actual result:
--------------
bool(false)
--
Edit bug report at http://bugs.php.net/?id=42007&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42007&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42007&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42007&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42007&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=42007&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42007&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42007&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42007&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42007&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42007&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=42007&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=42007&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42007&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42007&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42007&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42007&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42007&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42007&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42007&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42007&r=mysqlcfg