I'm trying something new for me:
class bar {
public function outside(){
function inside(){
return "baz";
}
}
}
$foo = new bar();
I want call two functions in one line (some like this):
echo $foo->outside()->inside(); // Fatal error: Uncaught Error: Call to a member function inside() on null
I thought it would return "baz but not. How I can build this syntax?