开发者

What php version allows this?

$var = a_function_that_returns_a_object()->property->something;

in old PHP versions you had to do this:

$obj = a_function_that_returns_a_object();
$var = $obj->property->something;

So from which PHP version does the first code work, without giving me a error ? I know that in 5.3 works bec开发者_StackOverflow社区ause I'm using it, but I want to know in what version it starts to break


Starting with PHP 5, method chaining is supported.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜