ID: 30378 Updated by: [EMAIL PROTECTED] Reported By: guth at fiifo dot u-psud dot fr -Status: Open +Status: Closed Bug Type: Documentation problem PHP Version: 5CVS-2004-10-10 (dev) New Comment:
This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. "... behave exactly like their C counterparts from ctype.h. It means that if you pass an integer smaller than 256 it will use the ASCII value of it to see if it fits in the specified range (digits are in 0x30-0x39). If the number is between -128 (inclusive) and 0 then 256 will be added and the check will be done on that." Previous Comments: ------------------------------------------------------------------------ [2004-10-11 07:56:30] [EMAIL PROTECTED] This is correct behavior though, as the numbers are automatically converted to strings in PHP, that's why it is called a losely-typed language. Though the manual should mention that if you pass an integer smaller than 256 it will use the ascii value of it to see if it fits in the specified range (digits are in 0x30-0x39). If the number is between -128 (inclusive) and 0 then 256 will be added and the check will be done on that again. ------------------------------------------------------------------------ [2004-10-10 00:15:45] guth at fiifo dot u-psud dot fr Description: ------------ See the following code : Reproduce code: --------------- echo "<?php var_dump(ctype_digit(1)) ?>" | php echo "<?php var_dump(ctype_digit(1000000000)) ?>" | php Expected result: ---------------- The prototype of this function is bool ctype_digit ( string text), so i expected : bool(false) bool(false) Actual result: -------------- bool(false) bool(true) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30378&edit=1