ID:               14580
 Comment by:       yakov at schmirnov dot net
 Reported By:      jlpriou at coleebris dot com
 Status:           Closed
 Bug Type:         Arrays related
 Operating System: Linux
 PHP Version:      4.3.0-dev
 New Comment:

the problem was \0 is the end of string marker in c.


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

[2002-07-08 03:02:16] [EMAIL PROTECTED]

This bug has been fixed in CVS. You can grab a snapshot of the CVS
version at http://snaps.php.net/. Thank you for the report, and for
helping us make PHP better.

Derick

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

[2002-07-03 21:03:37] [EMAIL PROTECTED]

Seems to fail only with \0 every other escape-sequence works fine.


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

[2001-12-18 10:32:36] jlpriou at coleebris dot com

We are trying using array wich contain as key a binary value.
We have no problem when storing this key and value in the array,
but when we want to get the key, the key is truncated  !

Tested with Php 4.0.6 and 4.1.0

<?
$key = "string\0withnull";
echo "strlen(" . urlencode($key) . ") = " . strlen($key) . "<br>";

$a = array($key => "val");

echo $a[$key] . "<br>";     // Result is correct

reset($a) ;
echo (key($a) == $key) ? "equal" : "not equal" ;    // part of the key
is lost
echo "(" . urlencode(key($a)) ." == ". urlencode($key) .")" ;
?>


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


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

Reply via email to