Overloading method of comparison for custom class

后端 未结 1 917
说谎
说谎 2021-01-25 13:19

I want to overload methods of comparison for a personnal class.

For example if I write this : $object1 < $object2 Php will use this function :

functi         


        
相关标签:
1条回答
  • 2021-01-25 13:53

    The PECL solution you point to above is your only option. PHP does not provide operator overloading as available in other languages.

    0 讨论(0)
提交回复
热议问题