PHP 4.0 Bug #10022: Constants not handled in arrays defined in class declaration

From: Date: Tue, 27 Mar 2001 14:54:03 +0000
Subject: PHP 4.0 Bug #10022: Constants not handled in arrays defined in class declaration
Groups: php.dev 
Request: Send a blank email to php-dev+get-50063@lists.php.net to get a copy of this message
From: cri@mindpass.com 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 <?php // // The following produces a warning // error_reporting(15); 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>"; print_r($example->hash); echo "<hr>Dump of \$example->otherHash<br>"; print_r($example->otherHash); ?> -- Edit Bug report at: http://bugs.php.net/?id=10022&edit=1

« previous php.dev (#50063) next »