In PHP, can you instantiate an object and call a method on the same line?

前端 未结 9 1872
没有蜡笔的小新
没有蜡笔的小新 2020-11-27 14:01

What I would like to do is something like this:

$method_result = new Obj()->method();

Instead of having to do:

$obj = ne         


        
9条回答
提交回复
热议问题