Instantiate and call a method in one line

maznos

New Member
Is there a way to instantiate a class and call one of its methods in one line? I hoped the following would work but it doesn't:\[code\](new User())->get_name();\[/code\]
 
Back
Top