Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67362 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13996 invoked from network); 7 May 2013 20:38:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 May 2013 20:38:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=drgomesp@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=drgomesp@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.171 as permitted sender) X-PHP-List-Original-Sender: drgomesp@gmail.com X-Host-Fingerprint: 209.85.216.171 mail-qc0-f171.google.com Received: from [209.85.216.171] ([209.85.216.171:50722] helo=mail-qc0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/88-06696-72669815 for ; Tue, 07 May 2013 16:37:59 -0400 Received: by mail-qc0-f171.google.com with SMTP id k15so557744qcv.2 for ; Tue, 07 May 2013 13:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=mabWUSGNm6MWNOFK9lxVJfQ4vnwW0hJHnLur72ueTWc=; b=tlfEuAAss138Ihb76z93lzI72nnXeKmZsSwL4cFIrVy5MmCnP2O4lYqaVfVIB8xZbf lAhpxFcjQh31MPL5uSc4AoiyEqB5KdvPX+0budiIG/2QoKqKYy2/mIOwbdRK4ZQnyQWb b1cKtJZzFCLwI7FtGav1nne5T6akr9oHH69Cg3TtjWcSc0pPe4GWENZc5fsmFkI5I/UD yh2Mm3F2r3lPQgjHOu38ghDHJK3AI91J8ISS5oqiFUgvI91MVhAd5ld+AymVRu8bOm6s jH0CfMqOKP2DViO2s18/uBYEYAqFJu1wbWNOelGoTd4CP2ahJBHT69QAAnLLnWl/pkzw nJ9g== X-Received: by 10.224.29.6 with SMTP id o6mr2862523qac.58.1367959077170; Tue, 07 May 2013 13:37:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.49.119.232 with HTTP; Tue, 7 May 2013 13:37:37 -0700 (PDT) In-Reply-To: <51896529.4030408@sugarcrm.com> References: <51896529.4030408@sugarcrm.com> Date: Tue, 7 May 2013 17:37:37 -0300 Message-ID: To: Stas Malyshev Cc: Adam Harvey , Thomas Anderson , PHP internals Content-Type: multipart/alternative; boundary=001a11c1de8edcb67b04dc26ca95 Subject: Re: [PHP-DEV] idea: implement a Comparable interface From: drgomesp@gmail.com (Daniel Ribeiro) --001a11c1de8edcb67b04dc26ca95 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable To me, it sounds that those extremely specific cases ask for a extremely specific compareTo(stdClass) method. Daniel Ribeiro Gomes Pereira Twitter | Facebook | LinkedIn iPhone: +55 (48) 9111-0931 2013/5/7 Stas Malyshev > Hi! > > > I wrote https://wiki.php.net/rfc/comparable a couple of years ago =97 > > there's a patch there that would probably still apply without too much > > work to master. About the only difference was that I didn't double > > underscore the magic method (in line with both Java and PHP interfaces > > like Countable). > > Overriding < and > isn't the biggest issue, even though BC issues with > conversions may definitely be a surprise. Bug biggest one is =3D=3D, whic= h > may have a lot of very non-trivial effects if you make =3D=3D return > "equals" when other functions (such as searches, hashes, etc.) may treat > them as not equal. It is quite a complex thing which is rife with > unexpected side effects, so I think it would be better if it were explici= t. > > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a11c1de8edcb67b04dc26ca95--