Change to function call semantics in PHP 5.1?

php.internals

Mark Spruiell

20 years ago
In PHP 5.0.x, I can chain function calls like this: $obj->method()->anotherMethod(); In PHP 5.1.x, this code results in an error: parse error, unexpected T_OBJECT_OPERATOR in ... I've looked through the change log for 5.1 but didn't see anything relevant. Was this an intentional change? Thanks, - Mark

Derick Rethans

20 years ago
On Tue, 21 Feb 2006, Mark Spruiell wrote:
> In PHP 5.0.x, I can chain function calls like this: > > $obj->method()->anotherMethod(); > > In PHP 5.1.x, this code results in an error: > > parse error, unexpected T_OBJECT_OPERATOR in ... > > I've looked through the change log for 5.1 but didn't see > anything relevant. > > Was this an intentional change?
Uh, this works fine in tons of our code... Derick
-- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org