Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86684 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3140 invoked from network); 15 Jun 2015 21:19:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jun 2015 21:19:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.174 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.174 mail-pd0-f174.google.com Received: from [209.85.192.174] ([209.85.192.174:34178] helo=mail-pd0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/24-15639-D514F755 for ; Mon, 15 Jun 2015 17:19:25 -0400 Received: by pdbki1 with SMTP id ki1so81199834pdb.1 for ; Mon, 15 Jun 2015 14:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=ZbWWVWV0dqfxn9YCYl5KPk6c35BNUacdF/G48NMz5+A=; b=u4RSq45zmcZUuAmV86cv+0T2HRa7N+CbRzj7GrgOstmGcnV44F6vXTZWoX67vNhP0L 2i9O7XHF2OagS7uRCnPcgAN4sl9IAKo1GYFvvKPc+LkVzPOLvVBVJYDtFm7xg0XzJWsE UO6xaDAtpBR0fVz0JhkBhacAsp8mdrqS6yAdx511aMHma85WvmgmZNo/m6x6Z25uJt7F IAIVJMsoSTi9/z/C+CuTTNUUrzF9/9wgg9pue8J/hz9Hz2zyo0wK2HeUa8pc26lf6YP0 s0y22EvLktv7mkQiivSR6AZuDM3i3OB8dKz8zlwCylrRSyS8ad2IO2RbJ53UrUb4FTXK InQg== X-Received: by 10.66.101.103 with SMTP id ff7mr52745337pab.13.1434403162656; Mon, 15 Jun 2015 14:19:22 -0700 (PDT) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id xv9sm13155300pbc.2.2015.06.15.14.19.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 14:19:22 -0700 (PDT) Message-ID: <557F4149.8040705@gmail.com> Date: Mon, 15 Jun 2015 14:19:05 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Rowan Collins , PHP Internals References: <06AFCBA8-CEB0-4AC1-BB72-ACA6213F4334@gmail.com> In-Reply-To: <06AFCBA8-CEB0-4AC1-BB72-ACA6213F4334@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Spaceship and NaNs From: smalyshev@gmail.com (Stanislav Malyshev) Hi! >> Just because other comparison ops already return a bool, we can return >> bool(false) there. But we can not return bool from operator that is declared as returning int, and adding extra type would make this operator essentially useless, as it is meant to be a concise way of comparing two things, and if after that you need to write a parser to figure out what it returned, it's much easier to just go back to basic comparison operators. Since not everything among PHP values is well-ordered, there would be sets of values for which comparison does not make intuitive sense - i.e. both < and > are false, etc. In this case, there is no intuitive value to return, but there should be a well-defined one to return, and we have a pretty good definition here I think: https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#relational-operators -- Stas Malyshev smalyshev@gmail.com