ID:               24783
 Updated by:       [EMAIL PROTECTED]
 Reported By:      david dot lamparter at t-online dot de
-Status:           Open
+Status:           Assigned
 Bug Type:         Arrays related
 Operating System: Linux
 PHP Version:      4.3.2
-Assigned To:      
+Assigned To:      zeev
 New Comment:

This same behaviour is with PHP 5.0.0b2-dev too.

FYI: This bug is NOT the same as bug #14580. (It was about key()
function, which still works fine)




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

[2003-07-23 19:42:10] david dot lamparter at t-online dot de

Description:
------------
(This Bug is the same as #14580 [Closed])

Using null bytes in array keys doesn't work correctly, the key gets cut
off at the null byte. (normal strings work, and array values work,
too)

I'm updating to 4.3.3-RC1 right now; if it doesn't work there too, i'll
try 5.0.0-Beta1

!!!!!!!!!!!!!!!!!!!!
Bug #14580 says this should be fixed, but it isn't (at least in
4.3.2-RC2); therefore I'm re-posting this

--------------------
System Information:

Apache 2.0.46 running on Linux 2.4.20, LFS system
glibc 2.3.1, gcc 3.2.2

First block from phpinfo():

PHP Version 4.3.2-RC2 

System  Linux charon 2.4.20-eq1-cx #4 Mit Jan 29 16:07:00 CET 2003 i686
 
Build Date  May 12 2003 14:43:04  
Configure Command  './configure' '--prefix=/opt/apache_2.0.45'
'--with-apxs2=/opt/apache_2.0.45/bin/apxs' '--enable-bcmath'
'--enable-calendar' '--enable-ftp' '--enable-mbstring'
'--enable-mbregex' '--enable-sockets' '--enable-xslt' '--with-openssl'
'--with-zlib' '--with-bz2' '--with-dom' '--with-dom-xslt'
'--with-dom-exslt' '--with-mysql=/usr/local/mysql' '--with-xslt-sablot'
'--with-snmp' '--with-imap=/usr' '--with-gd=/usr' '--with-png-dir=/usr'
'--with-jpeg-dir=/usr' '--with-freetype-dir=/usr' '--with-ldap'
'--with-gmp' '--with-iconv' '--with-xmlrpc'
'--with-db3=/usr/local/BerkeleyDB.3.3' '--enable-shmop'  
Server API  Apache 2.0 Handler  
Virtual Directory Support  disabled  
Configuration File (php.ini) Path  /opt/apache_2.0.45/lib  
PHP API  20020918  
PHP Extension  20020429  
Zend Extension  20021010  
Debug Build  no  
Thread Safety  disabled  
Registered PHP Streams  php, http, ftp, https, ftps, compress.bzip2,
compress.zlib  


Reproduce code:
---------------
<?
        $text = "abcd\0efgh";
        echo strlen ($text) . ": $text\n";

        $ar = array ("abcd\0efgh" => "value\0works");
        foreach ($ar as $key => $val)
                echo strlen ($key) . ": $key => " . strlen ($val) . ": $val\n";


Expected result:
----------------
9: abcdefgh
9: abcdefgh => 11: valueworks


Actual result:
--------------
9: abcdefgh
4: abcd => 11: valueworks



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


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

Reply via email to