#30862 [Opn->Bgs]: Static array with boolean indexes
| From: | derick@php.net | Date: | Mon, 22 Nov 2004 20:21:13 +0000 |
| Subject: | #30862 [Opn->Bgs]: Static array with boolean indexes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-69350@lists.php.net to get a copy of this message | ||
ID: 30862
Updated by: derick@php.net
Reported By: melnikow at hotbox dot ru
-Status: Open
+Status: Bogus
Bug Type: Arrays related
Operating System: WinXP
PHP Version: 5.0.2
New Comment:
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
.
Previous Comments:
------------------------------------------------------------------------
[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