From:             [EMAIL PROTECTED]
Operating system: linux
PHP version:      4CVS-2003-01-22 (stable)
PHP Bug Type:     Scripting Engine problem
Bug description:  false array keys

One can create a key as integer 0 and access it with key boolean false but
one cannot create an array with boolean false as the key.  In otherwords:

$arr = array(false => 'bar');      // array()
$arr = array((int)false => 'bar'); // array(0=>'bar')

$arr = array(0 => 'bar');
print $arr[false];            // bar
print $arr[(int)false];       // bar

This seems inconsistent.  From the documentation:

Using TRUE as a key will evalute to integer 1 as key. Using FALSE as a key
will evalute to integer  0 as key.

Please explain the reasoning behind the current behavior.
-- 
Edit bug report at http://bugs.php.net/?id=21814&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=21814&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=21814&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=21814&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=21814&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=21814&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=21814&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=21814&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=21814&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=21814&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=21814&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21814&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=21814&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=21814&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=21814&r=gnused

Reply via email to