note 22510 added to language.types.array

From: Date: Thu, 20 Jun 2002 14:58:03 +0000
Subject: note 22510 added to language.types.array
Groups: php.notes 
Request: Send a blank email to php-notes+get-32048@lists.php.net to get a copy of this message
"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 -- http://www.php.net/manual/en/language.types.array.php http://master.php.net/manage/user-notes.php?action=edit+22510 http://master.php.net/manage/user-notes.php?action=delete+22510 http://master.php.net/manage/user-notes.php?action=reject+22510

« previous php.notes (#32048) next »