ID:               29226
 Updated by:       [EMAIL PROTECTED]
 Reported By:      gyozo dot papp at chello dot hu
-Status:           Open
+Status:           Verified
 Bug Type:         Unknown/Other Function
 Operating System: Windows XP SP1
 PHP Version:      5.0.0
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

ctype_digit expects a string. If you want to use a int, you have to
cast the value: ctype_digit((string)$val);

However the crash occurs both with php4 and 5 on win but not on linux
(HEAD and PHP4_3).

--Pierre


Previous Comments:
------------------------------------------------------------------------

[2004-07-17 16:20:44] gyozo dot papp at chello dot hu

Description:
------------
I've just downloaded PHP5 distribution unpack it into c:\php5 to test
if ctype_digit works with agruments of integer type. But I've been
presented with some weird results some integer constants were passed
the check while other were not. 
The most weird thing was that giving 122113 as an argument to
ctype_digit() crashed the CLI.


Reproduce code:
---------------
c:\php5>php.exe -r "echo ctype_digit(1) ? 1 : 0;"
0
c:\php5>php.exe -r "echo ctype_digit(12) ? 1 : 0;"
0
c:\php5>php.exe -r "echo ctype_digit(123) ? 1 : 0;"
0
c:\php5>php.exe -r "echo ctype_digit(1234) ? 1 : 0;"
0
c:\php5>php.exe -r "echo ctype_digit(122) ? 1 : 0;"
0
c:\php5>php.exe -r "echo ctype_digit(12211) ? 1 : 0;"
1

This crashed the php.exe
c:\php5>php.exe -r "echo ctype_digit(122113) ? 1 : 0;"

Expected result:
----------------
I do not know exactly but at least the results of all tests should be
consistent. All the above integer arguments should be failed or passed
depending on design or implementation choice.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=29226&edit=1

Reply via email to