I’ve got two instances of a PHP5 Class (say ClassA), and I want to compare to see whether they are equal. In C#, I can write a .equals(ClassA other) method for ClassA, which will be overloaded onto the == operator.
Is there an equivalent way in PHP5 to overload a method in a class and have that be used for == comparison, or am I forced to do something like $instanceA->equals($instanceB)?
Ah, sorry missed the point of the question about overloading. It does not look like that is possible as stated above. However, I did find a helpful example for implementing your own.
I found this link showing some example code: Comparable equals