#21396 [Opn->Bgs]: after $var =pack(...) with 'N' flag, if use $var in $tmp[$var]='v' key is empty

From: Date: Sat, 04 Jan 2003 12:18:32 +0000
Subject: #21396 [Opn->Bgs]: after $var =pack(...) with 'N' flag, if use $var in $tmp[$var]='v' key is empty
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-29047@lists.php.net to get a copy of this message
ID: 21396 Updated by: sniper@php.net Reported By: slach@ems.ru -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: w2k, linux PHP Version: 4.2.3 New Comment: RTFM: http://www.php.net/manual/en/language.types.array.php "A key is either an integer or a string" Previous Comments: ------------------------------------------------------------------------ [2003-01-03 14:24:08] slach@ems.ru just see code <? error_reporting(E_ALL); $aa = pack("N",127); $bb = pack("N",65); $cc = pack("N",121344231); echo "$aa\n"; echo "$bb\n"; echo "$cc\n"; $tmp=array(); $tmp[$aa] = "aa"; $tmp[$bb] = "bb"; $tmp[$cc] = "cc"; var_dump($tmp); ?> output:  A ;Ð÷ array(3) { [""]=> string(2) "aa" ^^^^^^^ but needed [""] => "aa" ??? [""]=> string(2) "bb" [";Ð÷"]=> string(2) "cc" } WHY ? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21396&edit=1

« previous php.bugs (#29047) next »