Re: Problem using Classes like Structs in PHP 4
| From: | Martin | Date: | Thu, 07 Sep 2000 08:25:43 +0000 |
| Subject: | Re: Problem using Classes like Structs in PHP 4 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15670@lists.php.net to get a copy of this message | ||
Try new first();. I think, a class should have an (emtpy) constuctor.
Martin
Michael Crusi wrote:
> I set up classes in this way:
>
> class first {
> var $a;
> var $b;
> }
>
> class second {
> var $c;
> var $d= new first;
> }
>
> In PHP 3, this use of classes like a struct worked just fine. In PHP
> 4.0.1, I get a parse error when php parses the "var $d...." line.
>
> Can anyone clue me in on what has changed?
>
> Thanks!
>
> Mike
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net