Bug #12596: Definition of array using constants in array doesn't work

From: Date: Mon, 06 Aug 2001 13:41:56 +0000
Subject: Bug #12596: Definition of array using constants in array doesn't work
Groups: php.dev 
Request: Send a blank email to php-dev+get-62255@lists.php.net to get a copy of this message
From:             jack@mobil.cz
Operating system: Linux
PHP version:      4.0.5
PHP Bug Type:     Class/Object related
Bug description:  Definition of array using constants in array doesn't work

The following piece of code doesn't work:

<?
    define ('A', 20);

    class B
    {
	var $a = array(A => 10);
    }

    $b = new B();
    var_dump($b);
?>

It produces:

object(b)(1) {
  ["a"]=>
  array(1) {
    ["A"]=>
    int(10)
  }
}

which is unexpected (at least for me).
-- 
Edit bug report at: http://bugs.php.net/?id=12596&edit=1



Thread (6 messages)

« previous php.dev (#62255) next »