ID: 42007
Updated by: [EMAIL PROTECTED]
Reported By: adrian dot gheorghe at gmail dot com
Status: Open
-Bug Type: Unknown/Other Function
+Bug Type: Documentation problem
Operating System: Windows XP Sp2
PHP Version: 5.2.3
New Comment:
Documentation shouldn't say it's equivalent to regex matching when it
really isn't..docs need update, the function is fine as is.
Previous Comments:
------------------------------------------------------------------------
[2007-07-16 10:54:07] adrian dot gheorghe at gmail dot com
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 this bug report at http://bugs.php.net/?id=42007&edit=1