PHP 4.0 Bug #8141 Updated: "define" as array index in class definition is ignored
| From: | torben@php.net | Date: | Wed, 06 Dec 2000 22:31:22 +0000 |
| Subject: | PHP 4.0 Bug #8141 Updated: "define" as array index in class definition is ignored | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-40268@lists.php.net to get a copy of this message | ||
ID: 8141
Updated by: torben
Reported By: hp@oeri.ch
Status: Closed
Bug Type: Class/Object related
Assigned To:
Comments:
Not a bug. Class variable initializers must be static; do this
in the constructor instead.
Check out the text in the manual right after the first example
on the Classes page:
http://www.php.net/manual/language.oop.php
Hope this helps,
Torben
Previous Comments:
---------------------------------------------------------------------------
[2000-12-06 16:36:07] hp@oeri.ch
In the snippet below, the array entry "ABC"=>1 is simply ignored. An array
OUTSIDE of a class definition is fine!
<?
define( "ABC", 8 );
class test {
var $t = array( ABC => 1, 2 => 3 );
}
$u = New test();
var_dump( $u );
?>
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8141