|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-07-03 21:03 UTC] eru@php.net
[2002-07-08 03:02 UTC] derick@php.net
[2003-02-28 14:37 UTC] yakov at schmirnov dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 02:00:01 2025 UTC |
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) .")" ; ?>