note 85878 rejected from language.types.array by thiago

From: Date: Mon, 22 Sep 2008 16:55:11 +0000
Subject: note 85878 rejected from language.types.array by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-144616@lists.php.net to get a copy of this message
Note Submitter: akam at akameng dot com ---- Discussing this line of manual: "Using the empty string as a key will create (or overwrite) a key with the empty string and its value;" example: <?php $test = array('zero' => 'php.net', '' => 'php.net', "" => 'php.net' ); //test echo $test['zero']."\n<br />"; //output: php.net echo $test['']."\n<br />"; //output: php.net echo $test[""]."\n<br />"; //output: php.net foreach ($test as $key => $value ){ echo "\$key = $key and \$value = $value \n<br />"; } //out put /* $key = zero and $value = php.net $key = and $value = php.net */ ?> I think using empty string is work, so either the manual should change or the array behavior.

« previous php.notes (#144616) next »