Re: [PHP4BETA] class problem

From: Date: Mon, 19 Jul 1999 23:20:41 +0000
Subject: Re: [PHP4BETA] class problem
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-2269@lists.php.net to get a copy of this message
At 00:14 20/07/99 , Chad Cunningham wrote:
I dunno if this is a bug, so I figured I'd better check first to make sure syntax hasn't changed or anything. I have a class which creates a forum object for it's internal use, and with php4beta1, I'm getting a parse error on the line that creates it ( var $db = new db_class;). Is there something different I'm supposed to do for 4?
You stumbled upon one of the incompatibilities. Member variable initializations (and static variable initializations) can only be static values. You would have to move the initialization of $db to the constructor of the container class.
As a side note, apache failed to build when I compiled with aspell support, it gave a lot of errors for util.c.
Bugs db, with full information please :) It compiles clean for us on www.php.net. Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il

« previous php.version4 (#2269) next »