Considering this PHP example:
class A
{
public function getB( )
{
return new B();
}
}
class B
{
public function test( )
{
echo "Hello";
}
}
I could use this:
$a = new A( );
$b = $a->getB( );
$b->test( ); // Hello
Or this:
$a = new A();
$a->getB( )->test( ); // Hello
Taking a closer look at the second example...
- What is the name of this form of expression?
Does this have something to do with dereferencing?
In which programming languages is this available?
- What other forms of this exist?