Bug #1404: count() bug: count($Array["nonexistent"]) sets $Array["nonexistent"]=""
| From: | miko at cnt dot pl | Date: | Wed, 12 May 1999 15:46:00 +0000 |
| Subject: | Bug #1404: count() bug: count($Array["nonexistent"]) sets $Array["nonexistent"]="" | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-5574@lists.php.net to get a copy of this message | ||
From: miko@cnt.pl
Operating system: Linux RH5.2
PHP version: 3.0.6
PHP Bug Type: Misbehaving function
Bug description: count() bug: count($Array["nonexistent"]) sets
$Array["nonexistent"]=""
count($Array["nonexistent"]) sets $Array["nonexistent"]=""
Here is the script:
$T=array();
echo " isset: ".isset($T["a"])." count: ".count($T["a"]);
echo " isset: ".isset($T["a"])." count: ".count($T["a"]);
The result is: isset: 0 count: 1 isset: 1 count: 1, while I would expect
it to be: 0 0 0 0 (or 0 1 0 1).
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net