title: How to return errors from PHP method?
body: <p>I have a save method in my User class.</p>
  
  <p>If the save method encounters validation errors it returns an array of errors that I display to the user. However this means in my code I have to write:</p>
  
  <pre><code>if (!$user-&gt;save()) {
     //display success to user
  }
  </code></pre>
  
  <p>Surely my save method should return true on success. But how do I handle errors in that case?</p>