#4159 [Opn->Bgs]: Wrong count array after unset()

From: Date: Mon, 30 Sep 2002 23:18:17 +0000
Subject: #4159 [Opn->Bgs]: Wrong count array after unset()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-20817@lists.php.net to get a copy of this message
ID: 4159 Updated by: hholzgra@php.net Reported By: cbob@builder.cz -Status: Open +Status: Bogus Bug Type: Other Operating System: Linux RH, PHP Version: 3.0 Latest CVS (16/04/2000) New Comment: unsetting an array element doesn't renumber the element keys Previous Comments: ------------------------------------------------------------------------ [2000-04-16 12:05:28] cbob@builder.cz Test script: ------------ $x=array(1,2,3,4,5,6,7,8); for($i=0; $i<count($x); $i++) echo $x[$i]."<br>\n"; unset($x[2]); echo "<hr>"; for($i=0; $i<count($x); $i++) echo $x[$i]."<br>\n"; Output: 1 2 3 4 5 6 7 8 ------------------------------------------------------------ 1 2 4 5 6 7 but I thing, that it may be: 1 2 4 5 6 7 8 ????? It test it under: PHP-3.0.12 and PHP-4.0b1 and it is the same.... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=4159&edit=1

« previous php.bugs (#20817) next »