title: Is there a __equals method in PHP like there is in Java?
body: <p>Is there a pattern or magic method you can use in PHP to define when to compare two instances of a class?</p>
  
  <p>For example, in Java I could easily override the <code>equals</code> method and create a custom way of checking and compare two instances.</p>