$object->function()->first(array('str','str','str'))->secound(array(1,2,3,4,5));
This isn't strictly valid PHP, but what this is saying is... You are calling a method on the $object class that itself returns an object in which you are calling a method called first()
which also returns an object in which you are calling a method called second()
.
So, this isn't necessarily just one class (although it could be) with one method, this is a whole series of possibly different classes.
Something like:
class AnotherClass {
public function AnotherClassMethod() {
return 'Hello World';
}
}
class MyClass {
public function MyClassMethod() {
return new AnotherClass();
}
}
$object = new MyClass();
echo $object->MyClassMethod()->AnotherClassMethod(); // Hello World