On Tue, May 7, 2013 at 1:05 PM, Nikita Popov <nikita....@gmail.com> wrote:

> On Tue, May 7, 2013 at 6:17 PM, Thomas Anderson <zeln...@gmail.com> wrote:
>
>> It'd be nice if, when doing $objA > $objB, that that'd invoke
>> $objA->__compareTo($objB) or something, much like Java's Comparable
>> interface.
>>
>
> Do you have examples of what this would be useful for? The two things that
> come to mind are DateTime (which can do this anyway as it's an internal
> class) and classes for bignums or something like that (which are probably
> also better implemented internally). So I'm not sure how much use there is
> for this.
>

bignum PHP class:

http://phpseclib.sourceforge.net/math/intro.html

Per the benchmarks it's internal implementation (without OpenSSL) is faster
than BCMath is in 5.4 lol. Not sure which OS the test was ran on.

That's the only use case I can come up with off the top of my head but
that's more than I can come up with for Iterator atm lol.

Reply via email to