Re: idea: implement a Comparable interface

From: Date: Tue, 07 May 2013 16:28:56 +0000
Subject: Re: idea: implement a Comparable interface
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-67337@lists.php.net to get a copy of this message
> It'd be nice if, when doing $objA > $objB, that that'd invoke >> $objA->__compareTo($objB) or something, much like Java's Comparable >> interface. >> > > There is nothing stopping you from creating this in user-land. Also, I > have spent a lot of time writing libraries in PHP and I now believe that > this approach is not the best solution anyway. > Except for the magic that happens on the comparison, I mean. I really don't think PHP should go down that road at this point, if ever.

« previous php.internals (#67337) next »