note 22510 deleted from language.types.array by betz
| From: | betz@php.net | Date: | Tue, 27 Sep 2005 09:08:54 +0000 |
| Subject: | note 22510 deleted from language.types.array by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-95863@lists.php.net to get a copy of this message | ||
Note Submitter: maxim at php dot net
----
"A key is either a nonnegative integer or a string..."
This is incorrect. If you try this code:
<?
$array[-5] = 'minus five';
$array[] = 'minus four ';
$array[] = 'minus three';
$array[] = 'minus two';
$array[] = 'minus one';
$array[] = 'zero';
$array[] = 'one';
$array[] = 'two';
$array[] = 'three';
$array[] = 'four';
echo "<pre>";
print_r($array);
echo "</pre>";
?>
the result would be:
Array
(
[-5] => minus five
[-4] => minus four
[-3] => minus three
[-2] => minus two
[-1] => minus one
[0] => zero
[1] => one
[2] => two
[3] => three
[4] => four
)
I will fix this in the documentation.
Maxim Maletsky,
maxim@php.net