note 51134 deleted from language.types.array by betz
| From: | betz@php.net | Date: | Tue, 18 Oct 2005 06:18:09 +0000 |
| Subject: | note 51134 deleted from language.types.array by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-97137@lists.php.net to get a copy of this message | ||
Note Submitter: arhipov at donotspam at narod dot ru
----
Strange behavior of array
It is found on PHP 4.3.10, 5.0.2
<?php
$test["a"]=123;
echo
"*".$test["a"]."*".$test["a"]["b"]."*";
?>
This example prints *123**
It is true because $test["a"]["b"] is not assigned
<?php
$test["a"]="123";
echo
"*".$test["a"]."*".$test["a"]["b"]."*";
?>
This example prints *123*1*
PHP prints first symbol of $test["a"] as value of non-existent element