#3079 [Opn->]: Unset() leaves holes in arrays
| From: | hholzgra@php.net | Date: | Tue, 01 Oct 2002 16:05:13 +0000 |
| Subject: | #3079 [Opn->]: Unset() leaves holes in arrays | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-20950@lists.php.net to get a copy of this message | ||
ID: 3079
Updated by: hholzgra@php.net
Reported By: tobias@dnet.it
-Status: Open
+Status: Won't fix
Bug Type: Misbehaving function
Operating System: Suse Linux 6.1
PHP Version: 3.0.13
New Comment:
We are sorry, but can not support PHP 3 related problems
anymore. Momentum is gathering for PHP 5, and we think
supporting PHP 3 will lead to a waste of resources which
we want to put into getting PHP 5 ready. Ofcourse PHP 4
will continue to be supported for the forseeable future.
for a) unset doesn't renumber, remember that all php
arrays are actually hashes
b) well, see message above
Previous Comments:
------------------------------------------------------------------------
[2000-01-01 11:44:40] tobias@dnet.it
Unset(), when applied to array elements, leaves holes in the array.
Take this code:
$array = array("a");
unset($array[0]);
$array[] = "d";
var_dump($array);
This will produce the following output with PHP 3.0.12 and 3.0.13:
array(2) {
int(1)
string(1) "d"
}
a) It would make more sense if the index would be 0.
b) var_dump() sees the array as containing two elements. Count() works
fine, though. PHP 4.x's var_dump() shows correctly array(1).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=3079&edit=1