Initializing class properties
| From: | Lance Lovette | Date: | Wed, 29 Nov 2000 19:20:21 +0000 |
| Subject: | Initializing class properties | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-27859@lists.php.net to get a copy of this message | ||
Before PHP 4 I could initialize class properties that were objects like
this:
class A
{
};
class B
{
var $x = new A;
};
PHP 4 gives me a parse error when trying to initialize $x. Is there a way to
make PHP 4 work like it used to or must I move all object property
initializations to the class constructor?
Lance