Comparison operator overloading in php

前端 未结 3 1846
抹茶落季
抹茶落季 2020-12-18 08:02

Is it possible to overload the ==/!= operators in php, similar to the way it\'s done in .NET?

3条回答
  •  庸人自扰
    2020-12-18 08:41

    Just for reference (as this identical question has been asked several times today), nikic has just posted details of a Comparable interface that overloads comparison operators for objects - https://github.com/nikic/comparable

提交回复
热议问题