From:             gyozo dot papp at chello dot hu
Operating system: Windows XP SP1
PHP version:      5.0.0
PHP Bug Type:     Unknown/Other Function
Bug description:  ctype_digit()'s unpredictable results in CLI 

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 bug report at http://bugs.php.net/?id=29226&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29226&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29226&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29226&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29226&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29226&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29226&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29226&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29226&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29226&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29226&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29226&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29226&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29226&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29226&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29226&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29226&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29226&r=float

Reply via email to