Bug #11604 Updated: count() error codes

From: Date: Fri, 22 Jun 2001 22:17:19 +0000
Subject: Bug #11604 Updated: count() error codes
Groups: php.dev 
Request: Send a blank email to php-dev+get-57703@lists.php.net to get a copy of this message
ID: 11604 Updated by: hholzgra Reported By: vroemisse@home.nl Old-Status: Open Status: Bogus Bug Type: Feature/Change Request Operating system: PHP Version: 4.0.5 Assigned To: Comments: you should use is_array() for argument type checking *before* calling count() or sizeof() Previous Comments: --------------------------------------------------------------------------- [2001-06-21 11:17:33] vroemisse@home.nl count($var) can return 0 if $var is not set and 1 if $var is not an array. In my view these overlap with proper return values - I can have an empty array and I can have an array with only 1 element. Actually, I often do. Please make count($var) return -1 and -2 in these cases so I can reliably determine what's the situation with $var. --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=11604&edit=2

« previous php.dev (#57703) next »