PHP 4.0 Bug #4908: 'unset' inconsistency
| From: | thomasjf at seas dot upenn dot edu | Date: | Thu, 08 Jun 2000 15:49:45 +0000 |
| Subject: | PHP 4.0 Bug #4908: 'unset' inconsistency | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-20580@lists.php.net to get a copy of this message | ||
From: thomasjf@seas.upenn.edu
Operating system: WinNT 4.0
PHP version: 4.0 Release Candidate 2
PHP Bug Type: Misbehaving function
Bug description: 'unset' inconsistency
It seems that the 'unset' function fails to handle empty array keys properly:
<?
$z = array();
unset($key);
echo "Test unset with key = '$key'<br>\n";
$z[$key] = 1;
unset($z[$key]);
while( list($k, $v) = each($z) ){
echo "$k: $v <br>\n";
}
$z = array();
$key = 9;
echo "Test unset with key = '$key'<br>\n";
$z[$key] = 1;
unset($z[$key]);
while( list($k, $v) = each($z) ){
echo "$k: $v <br>\n";
}
?>