ID: 12626
Updated by: jeroen
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Analyzed
Bug Type: Scripting Engine problem
Operating System: win32
PHP Version: 4.0.6
New Comment:
Reworded: str->int conversion isn't binary safe (strtol isn't...).
A fix would make the commonly (implicitely) used str->int conversion slower... I can
think of a few ways to fix this, but didn't check the performance impact.
In PHP, everything is supposed to work regardless of ascii 0 bytes in a string.
Previous Comments:
------------------------------------------------------------------------
[2001-08-07 12:36:17] [EMAIL PROTECTED]
if you convert a string containing chr(0) characters to an int, php cuts off
conversion on reaching the first ascii 0. The resulting integer is incorrect, of
course.
I found it out having a string constructed of concatenated single characters which
would not convert correctly. However, checking the string length would show more
characters than those visible.
Basic string handling stuff seems to work ok on those strings, however. This seems
weird because I would have expected php to consider the first 0 character terminate
the string, which it does not. Or does it?
Stefan
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=12626&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]