How can I do multiple levels of de-referencing? For instance, in C#, we can keep appending a ‘.’ to access the next objects properties: string s, s.ToString(), s.ToString().ToUpper(). With PHP, I get to around $this->someobject, but $this->someobject->somethingelse does not appear to work.
Any ideas?
Assuming you’re using
PHP5+, and$this->someobjectreturns an object with a property calledsomethingelse; it should work.Similarly, this also works
Edit:
Just as a further note, you don’t have to return
self. Any object will suffice.