title: Howto chain objects in PHP5: $this->foo->bar->baz()
body: <p>How do I make chained objects in PHP5 classes? Examples:    </p>
  
  <pre><code>$myclass-&gt;foo-&gt;bar-&gt;baz();
  $this-&gt;foo-&gt;bar-&gt;baz();
  Not: $myclass-&gt;foo()-&gt;bar()-&gt;baz();
  </code></pre>
  
  <p>See also:<br><a href="http://www.talkphp.com/advanced-php-programming/1163-php5-method-chaining.html" rel="nofollow noreferrer">http://www.talkphp.com/advanced-php-programming/1163-php5-method-chaining.html</a></p>