Undocumented change in class member initialization ?
| From: | Huba Gaspar | Date: | Tue, 10 Aug 1999 10:02:47 +0000 |
| Subject: | Undocumented change in class member initialization ? | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-3270@lists.php.net to get a copy of this message | ||
Hi!
Is it intentional that the redefinition of preinitialized class variables
is not work in php4 beta 1?
class Father
{
var $name = "Peter";
}
class Child extends Father
{
var $name = "Pal";
}
That way of redefinition worked in php-3, but in php4 beta 1 $name
can only be changed in a class method. I didn't found any reference to
this new feature in the incompatibility list. Since I used it heavily in
my code it makes me a lot of trouble (work) to port my old php3 code to
php4. I understood that expressions can't be used in class member
intialization any more but I think that what I mentioned is another
incompatibility. I suggest including this change in the inclompatibility
list if it's intentional or fixing it if it's a bug.
Thanks
Huba