Page 1 of 1

$object->methodReturnsObject()->doFoo(); parse error

Posted: Thu Jun 01, 2006 9:15 pm
by Nathaniel
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/yogler/includes/controllers/page_controller.test.php on line 30

Doing:

Code: Select all

$method = $object->methodReturnsObject();
$method->doFoo();
works fine.

Why is that? Is there a workaround? I guess I could do $object->other_object->doFoo();...

Posted: Thu Jun 01, 2006 9:40 pm
by sweatje
Upgrade to PHP5 is unfortunatly the only answer.

Posted: Thu Jun 01, 2006 10:25 pm
by Nathaniel
Bah.

Thanks.

Posted: Tue Jun 06, 2006 7:26 am
by sweatje
A spammer just hit this old blog post of mine: http://blog.casey-sweat.us/?p=38

Which reminded me of this topic. Kind of a hack, but might be of some use to you.