PHP 4.0 Bug #8141 Updated: "define" as array index in class definition is ignored

From: Date: Thu, 07 Dec 2000 08:54:10 +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-40321@lists.php.net to get a copy of this message
ID: 8141 Updated by: stas Reported By: hp@oeri.ch Status: Analyzed Bug Type: Class/Object related Assigned To: Comments: Actually, it is a bug. It doesn't give any error, produces undesired behaviour and leaks memory. This should be fixed either way - or give warning/error, or work - and in either case not to leak. Previous Comments: --------------------------------------------------------------------------- [2000-12-06 17:31:22] torben@php.net 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 --------------------------------------------------------------------------- [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

« previous php.dev (#40321) next »