PHP 4.0 Bug #2599 Updated: class variables

From: Date: Sat, 10 Feb 2001 19:00:15 +0000
Subject: PHP 4.0 Bug #2599 Updated: class variables
Groups: php.dev 
Request: Send a blank email to php-dev+get-46222@lists.php.net to get a copy of this message
ID: 2599 Updated by: hholzgra Reported By: jymil@hotmail.com Old-Status: Open Status: Closed Bug Type: Feature/Change Request Assigned To: Comments: sorry, only constant values may be used for initial assignments to member variables in php 4 do it in a constructor instead see http://www.php.net/manual/en/x45905.php Previous Comments: --------------------------------------------------------------------------- [2001-02-10 13:51:00] jimw@php.net i believe this is by design. i'll let zeev close it if so. --------------------------------------------------------------------------- [1999-10-25 04:21:28] jymil@hotmail.com Variable declarations in classes can't refer to other variables in that class, only value assigments are allowed. The following example does not work: class test { var $testvar = "this is a test"; var $test2 = $this->testvar; } Would be nice if such things were possible. --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=2599&edit=2

« previous php.dev (#46222) next »