title: How do I chain methods in PHP?
body: <p>jQuery lets me chain methods. I also remember seeing the same in PHP so I wrote this:</p>
  
  <pre><code>class cat {
   function meow() {
   echo "meow!";
   }
  
  function purr() {
   echo "purr!";
   }
  }
  
  $kitty = new cat;
  
  $kitty-&gt;meow()-&gt;purr();
  </code></pre>
  
  <p>I cannot get the chain to work. It generates a fatal error right after the meow. </p>