[PHP-DEV] Bug #13138: constants behave weird in static hash arrays From: jack <email protected>
Date: 09/04/01

From: jack <email protected>
Operating system: linux
PHP version: 4.0.4pl1
PHP Bug Type: Scripting Engine problem
Bug description: constants behave weird in static hash arrays

I think the following piece of code behaves sort of weird:

<?
    define ('A', 1);

    function test()
    {
        $a = array(1 => true);
        static $stat_a = array(A => true);

        var_dump($a);
        var_dump($stat_a);
    }
    test();
?>

result is:
array(1) {
  [1]=>
  bool(true)
}
array(1) {
  ["A"]=>
  bool(true)
}

I'm not sure whether static variables are supposed to evaluate expressions
but even if they were not, the engine should at least issue a warning.

-- 
Edit bug report at: http://bugs.php.net/?id=13138&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>