Array indexing BC question

From: Date: Mon, 23 Jun 2003 21:52:37 +0000
Subject: Array indexing BC question
Groups: php.internals 
Request: Send a blank email to internals+get-2667@lists.php.net to get a copy of this message
Hi out there, Wondering what should go into the docs about this: It seems that array appending has changed wrt negative indices. I had just documented the new behaviour but now I'm not entirely sure whether I've just documented an unintentional change. Is this new behaviour what is desired (i.e. skipping straight from some negative key to 0 when appending with $arr[] = <expr>)? Thanks for any insight, Torben Test script: <?php $arr[-5] = "minus five"; $arr[] = "minus four"; var_dump($arr); ?> Output PHP 4.2.1: array(2) { [-5]=> string(10) "minus five" [-4]=> string(10) "minus four" } Output PHP 4.3.2: array(2) { [-5]=> string(10) "minus five" [0]=> string(10) "minus four" } -- Torben Wilson <torben@php.net> +1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com -----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----

« previous php.internals (#2667) next »