note 106878 deleted from language.types.array by danbrown
| From: | danbrown@php.net | Date: | Tue, 03 Jan 2012 22:11:20 +0000 |
| Subject: | note 106878 deleted from language.types.array by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185328@lists.php.net to get a copy of this message | ||
Note Submitter: jakoch at web dot de
----
# This is related to a question in a bogus bug report
# https://bugs.php.net/bug.php?id=60525
# Hope you understand array indexes a bit better
<?php
$test = array('fruit'=>'apple');
echo $test['fruit']['test']; # 'test' = 0; stdout: a
echo $test['fruit']['']; # '' = 0; stdout: a
echo $test['fruit'][0]; # a
echo $test['fruit'][1]; # p
echo $test['fruit'][2]; # p
echo $test['fruit'][3]; # l
echo $test['fruit'][4]; # e
echo $test['fruit'][5]; # Notice: Uninitialized string offset: 5
echo $test['fruit'][0][1]; # Fatal Error : Cannot use string offset as an array