Re: Two ZE2 problems
| From: | Sander Roobol | Date: | Fri, 21 Feb 2003 16:55:00 +0000 |
| Subject: | Re: Two ZE2 problems | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-94441@lists.php.net to get a copy of this message | ||
On Fri, Feb 21, 2003 at 10:47:16AM -0600, Brian Moon wrote:
> | class foo {}
> | class bar {
> | var $baz = 'foo';
> | }
> | $bar = new bar();
> | $foo = new $bar->baz; // let's call this line 6
> |
> | It runs fine on ZE1, but ZE2 bails out with "parse error, unexpected
> | T_OBJECT_OPERATOR on line 6".
>
> Should this work? YOu are using new with a returned value that is not an
> object.
Yes. The following example works with both ZE1 and 2, so there's no
reason that the code above shouldn't.
class foo {}
$bar = 'foo';
$foo = new $bar;
Sander