What I would like to do is something like this:
$method_result = new Obj()->method();
Instead of having to do:
$obj = ne
You can do it more universally by defining an identity function:
function identity($x) { return $x; } identity(new Obj)->method();
That way you don't need to define a function for each class.