In php reading from here
http://docs.php.net/manual/en/migration54.new-features.php
It says,
Class member access on instantiation has been added, e.g. (new Foo)->bar().
I have a class and call its methods like below (as I cannot do what it says above!!),
$router = new RouterCore();
$method = $router->method;
$controller = new $router->controller();
$controller->$method();
What is the syntax for doing what is stated above when both of the class name and the method name exist as properties of another class? I have tried what is below;
$router = new RouterCore();
new ($router->controller())->$router->method(); // no go
new $router->controller()->$router->method(); // no go
new ($router->controller()->$router->method()); // no go