From:             [EMAIL PROTECTED]
Operating system: Linux
PHP version:      4.0.4pl1
PHP Bug Type:     Class/Object related
Bug description:  Constants not handled in arrays defined in class declaration


//  The following produces a warning


define("A", 1);
define("B", 2);
define("C", 3);

class Example {
    var $hash = array(A  => "test1",
                      B  => "test2",
                      C  => "test3");
    var $otherHash;
    function Example() {
        $this->otherHash = array(A   => "test1",
                                 B  => "test2",
                                 C   => "test3");


$example = new Example;

echo "<hr>Trying \$example->hash[B]:<br>";
echo $example->hash[B];

echo "<hr>Trying \$example->otherHash[B]<br>";
echo $example->otherHash[B];

echo "<hr>Dump of \$example->hash<br>";

echo "<hr>Dump of \$example->otherHash<br>";

Edit Bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to