Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96769 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32984 invoked from network); 8 Nov 2016 12:36:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Nov 2016 12:36:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=lauri.kentta@gmail.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=lauri.kentta@gmail.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain gmail.com does not designate 188.117.41.47 as permitted sender) X-PHP-List-Original-Sender: lauri.kentta@gmail.com X-Host-Fingerprint: 188.117.41.47 mailgateway.locotech.fi Linux 2.6 Received: from [188.117.41.47] ([188.117.41.47:51397] helo=mailgateway.locotech.fi) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 92/D0-23587-144C1285 for ; Tue, 08 Nov 2016 07:25:38 -0500 Received: from localhost (mailgateway [127.0.0.1]) by mailgateway.locotech.fi (Postfix) with ESMTP id 55A5BA3762C; Tue, 8 Nov 2016 14:25:34 +0200 (EET) X-Virus-Scanned: amavisd-new at locotech.fi X-Spam-Flag: NO X-Spam-Score: -1.998 X-Spam-Level: X-Spam-Status: No, score=-1.998 tagged_above=-9998 required=5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9] autolearn=no autolearn_force=no Received: from mailgateway.locotech.fi ([127.0.0.1]) by localhost (mailgateway.locotech.fi [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qzAe5fzuJN6K; Tue, 8 Nov 2016 14:25:19 +0200 (EET) Received: from posti.fimnet.fi (posti.fimnet.fi [172.16.1.44]) by mailgateway.locotech.fi (Postfix) with ESMTP id 955C0A3762B; Tue, 8 Nov 2016 14:25:13 +0200 (EET) Received: from k-piste.dy.fi (unknown [172.16.1.39]) by posti.fimnet.fi (Postfix) with ESMTPSA id 550EA101E10; Tue, 8 Nov 2016 14:25:13 +0200 (EET) Received: from localhost.localdomain ([::1] helo=k-piste.dy.fi) by k-piste.dy.fi with esmtp (Exim 4.87) (envelope-from ) id 1c45Sj-00033l-3v; Tue, 08 Nov 2016 14:25:13 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 08 Nov 2016 14:25:13 +0200 To: David Walker Cc: internals@lists.php.net, Andrea Faulds , Fleshgrinder In-Reply-To: References: Message-ID: X-Sender: lauri.kentta@gmail.com User-Agent: Roundcube Webmail/1.2.2 Subject: Re: [PHP-DEV] [RFC] Interval Comparison From: lauri.kentta@gmail.com (=?UTF-8?Q?Lauri_Kentt=C3=A4?=) On 2016-11-07 23:51, David Walker wrote: > On Mon, Nov 7, 2016 at 1:38 PM Fleshgrinder > wrote: >> We are only extending binary to ternary for <= and <. > > I realize that my comment, and question were going a bit off-topic with > going on about the chaining of comparisons, but I'm interested in it > more > because I wonder which would be harder to implement. It would seem to > me > that it would be harder to implement a means in which you only allow > one > additional layer of comparison, rather than abstract chaining of > comparisons (<, <=, >, >=). I'm pretty sure that a three-part comparison is easier to implement. It can be kind of hard-coded as a new type of syntax, somewhat like the ternary operator. Personally I'd prefer the full Python-style chaining. It's a lot more useful, especially for cases like 0 < $a <= $b < $upper_limit. One possible implementation idea (not knowing anything about Zend): Comparison (a