When i use the some php frameworks or libraries i can write code like this:
$avariable = new aClass();
$avariable->someFunction()->somevalue
(I want to create structure like this.)
I try create a class name Customer
class Customer {
public function getCustomer($name,$email,$age){
...
$customer = new \stdClass();
$customer->description = 'Description';
return $customer;
}
}
And then try
$customer= new Customer();
$customer->getCustomer('name','email','age')->description ;
Why my code is not work
$customer->getCustomer('name','email','age')->description;
thanks