Re: RFC: Comparable interface

From: Date: Thu, 30 Sep 2010 14:24:01 +0000
Subject: Re: RFC: Comparable interface
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-49811@lists.php.net to get a copy of this message
On Thu, 2010-09-30 at 21:33 +0800, Adam Harvey wrote: > All, > > I've just written an RFC (with a patch against trunk) to implement a > Comparable interface similar to that in Java — in effect, allowing > object instances to be compared with semantics defined in userspace. > This is admittedly at the lower end of RFC-worthy proposals, but it's > a good system, and I'd like to see it used a little more. Plus, it's > good practice for the more interesting stuff to come. :) What is this "more interesting stuff to come"? - currently it is a bit syntactic sugar, one might argue a feature which makes reading code harder(*), and we are careful with adding such. (*) Right now it is quite clear what happens if you read $a == $b there are a few edge cases (0 == "100000 mails ina thread") but overall quite clear. With your patch "anything" might happen, which is hard to detect as we don't enforce strong typing, which would give a hint. johannes

« previous php.internals (#49811) next »