I know, quite a subject line :) [b]the problem:[/b] I create an object of class a: [code] class a { getOtherObject() { $newobject = new b(); return $newobject; } } class b { myFunction() { ... } } [/code] Now, I want to access myFunction like this: [code] $obj = new a(); $obj->getOtherObject()->myFunction(); [/code] This produces a [i]parse error, unexpected T_OBJECT_OPERATOR[/i]. [b]How can I call the member function of the object returned by getOtherObject()?[/b] [i]It works if I store the result of getOtherObject() in a variable first and access the function afterwards from the variable. But there must be a way to do this inline, like in C# or JavaScript. If getOtherObject were a variable, things would work fine too. (like $obj->getOtherObject->myFunction())[/i] Thanks! Ruben