ID: 30862 User updated by: melnikow at hotbox dot ru Reported By: melnikow at hotbox dot ru Status: Assigned Bug Type: Arrays related Operating System: WinXP PHP Version: 5.0.2 Assigned To: andi New Comment:
Yes :) I agree, manual tells about implicitly converting, but there is no way to get access to array with any index of 0, 1, FALSE, TRUE. Previous Comments: ------------------------------------------------------------------------ [2004-11-22 22:36:08] [EMAIL PROTECTED] This is actually valid, a shorter script: php -r 'class T{static $a=array(false=>"false",true=>"true");} print_r(T::$a);' ------------------------------------------------------------------------ [2004-11-22 21:21:11] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php . ------------------------------------------------------------------------ [2004-11-22 16:49:47] melnikow at hotbox dot ru Description: ------------ With use of static array with boolean indexes inside the class methods occurs implicitly converting boolean to integer. Reproduce code: --------------- <?php class ClassA { public static $arr = array(FALSE => "This is FALSE", TRUE => "This is TRUE"); static public function test() { $arr = array(FALSE => "This is FALSE", TRUE => "This is TRUE"); echo self::$arr[TRUE]; echo "<br>".$arr[TRUE]; } } ClassA::test(); ?> Expected result: ---------------- This is TRUE This is TRUE Actual result: -------------- Notice: Undefined offset: 1 in ... on line 13 This is TRUE ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30862&edit=1