note 7569 deleted from unset by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Thu, 07 Sep 2000 13:56:18 +0000 |
| Subject: | note 7569 deleted from unset by jmcastagnetto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4316@lists.php.net to get a copy of this message | ||
Also, for some stupid, stupid reason, when you use unset() on an array, it not only removes the item
but it reduces the index, and not in a way you'd expect.
For example:
$dope = array("a", "b", "c", "d", "e");
unset($dope[1]);
What *should* happen is the second array item (b) should disappear. What *does* happen is that
$dope[1] is unset, AND the index is reduced, but the item isn't deleted. So your array now goes
"a", (blank), "c", "d". Both "b" and "e" were
lost.
Very annoying.