ID: 21814 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Assigned Bug Type: Scripting Engine problem Operating System: linux PHP Version: 4CVS-2003-01-22 (stable) -Assigned To: +Assigned To: iliaa
Previous Comments: ------------------------------------------------------------------------ [2003-01-22 03:30:25] [EMAIL PROTECTED] 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 this bug report at http://bugs.php.net/?id=21814&edit=1