How to chain method on a newly created object?
In PHP 5.4+, the parser’s been modified so you can do something like this (new Foo())->xyz(); Wrap the instantiation in parenthesis, and chain away. Prior to PHP 5.4, when you’re using the new Classname(); syntax, you can’t chain a method call off the instantiation. It’s a limitation of PHP 5.3’s syntax. Once an object is …