Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72540 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15472 invoked from network); 13 Feb 2014 04:01:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Feb 2014 04:01:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.199 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.199 imap2-2.ox.registrar-servers.com Received: from [192.64.116.199] ([192.64.116.199:50109] helo=imap2-2.ox.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6D/D1-19387-6A34CF25 for ; Wed, 12 Feb 2014 23:01:43 -0500 Received: from [192.168.0.200] (unknown [90.220.179.188]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id 935405A006C; Wed, 12 Feb 2014 23:01:39 -0500 (EST) Message-ID: <52FC43A1.6050902@ajf.me> Date: Thu, 13 Feb 2014 04:01:37 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Davey Shafik , internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Combined Comparison Operator From: ajf@ajf.me (Andrea Faulds) On 13/02/14 03:58, Davey Shafik wrote: > This adds a new operator "(expr) <=> (expr)" that returns 0 if both > operands are equal, 1 if the left is greater, and -1 if the right is > greater. > > It works with all types (just as well as <, <=, >=, > work) and is great > for usort() callbacks for example. It's useful and cool, and adds an awesome new operator name ((T_SPACESHIP <=> T_PAAMAYIM_NEKUDOTAYIM) === 1), but would it be used often enough to justify addition? -- Andrea Faulds http://ajf.me/