Posted by gosha bine on 07/06/07 11:11
On 06.07.2007 08:27 Phil Latio wrote:
> Here is some basic example code:
>
> $newUser = new User();
> if ($newUser->SaveNewUser())
> {
> echo "success";
> }
> else
> {
> echo "failure";
> }
>
> Question. Can I modify the above so I instantiate a new object within an if
> statement and apply a method all on one line?
>
> Cheers
>
> Phil
>
>
>
>
No, this is a limitation of php parser
(new Object)->method()
is not possible. Don't ask why. ;)
--
gosha bine
extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
Navigation:
[Reply to this message]
|