Re: Method chaining off constructors
| From: | Christoph Boget | Date: | Fri, 06 Jun 2008 15:35:10 +0000 |
| Subject: | Re: Method chaining off constructors | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-275099@lists.php.net to get a copy of this message | ||
> The 'new' keyword has to apply to the object created in the constructor (and
> not the return value of any of the follow-up calls.) To establish this
> precedence, chaining wasn't allowed on constructors.
If precedence was the issue, why doesn't this work, either:
(new bob())->one()->two()
? Or, rather, why couldn't that have been taken into consideration?
thnx,
Christoph