title: Does using method chaining in PHP cause any problems with resources or memory?
body: <p>I'm talking about methods like this:</p>
  
  <pre><code>    $object-&gt;method()-&gt;method1('param')-&gt;method2('param');
  </code></pre>
  
  <p>Those are created by returning the object in the function.</p>
  
  <pre><code>    return $this;
  </code></pre>
  
  <p>I've seen third-party software use that method, but I'm wondering, wouldn't that cause a bit of a problem with the resources or memory because you're continuously returning the entire object?</p>