Bug #12626: string to int incorrect if string containts 0 characters
| From: | stefan dot priebsch at e-novative dot de | Date: | Tue, 07 Aug 2001 16:36:17 +0000 |
| Subject: | Bug #12626: string to int incorrect if string containts 0 characters | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-62442@lists.php.net to get a copy of this message | ||
From: stefan.priebsch@e-novative.de
Operating system: win32
PHP version: 4.0.6
PHP Bug Type: Scripting Engine problem
Bug description: string to int incorrect if string containts 0 characters
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 bug report at: http://bugs.php.net/?id=12626&edit=1