|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-08-25 16:50 UTC] phpbugs dot 20 dot zsh at spamgourmet dot com
Description: ------------ ctype_alnum returns false if an integer is passed. Reproduce code: --------------- <?php $var = 42; var_dump($var, "$var"); ?> Expected result: ---------------- bool(true) bool(true) Actual result: -------------- bool(false) bool(true) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 11:00:02 2025 UTC |
Oops, the reproduce code should be: <?php $var = 42; var_dump(ctype_alnum($var), ctype_alnum("$var")); ?>I don't see the problem! PHP is a weak-typed language... what about sleep() for instance? void sleep ( _int_ $seconds ) <?php sleep('5'); ?> So why shouldn't ctype_alnum just accept all scalar values as strings?