Does php support operator overloading?
I\'m trying to create a class that takes in a date and I\'d like to compare it with another object without having to use methods o
PHP's interpretation of "overloading" is different than most object oriented languages. Overloading traditionally provides the ability to have multiple methods with the same name but different quantities and types of arguments.
I hope this link will help you to understand concept,
http://php.net/manual/en/language.oop5.overloading.php
PHP doesn't support operator overloading.
There is an ancient extension which allowed to do this in a manner similar to python. You can find it here.
That being said, your best bet nowadays is to just use regular methods for comparison.