Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96836 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19351 invoked from network); 11 Nov 2016 18:25:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Nov 2016 18:25:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.84 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.84 mx103.easyname.com Received: from [77.244.243.84] ([77.244.243.84:51622] helo=mx202.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 15/AA-35596-F0D06285 for ; Fri, 11 Nov 2016 13:25:22 -0500 Received: from cable-81-173-133-127.netcologne.de ([81.173.133.127] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1c5GVn-0005fi-NG; Fri, 11 Nov 2016 18:25:15 +0000 Reply-To: internals@lists.php.net References: <3e3180e8-e9c2-abca-5228-221f8eae713d@fleshgrinder.com> To: David Walker , internals@lists.php.net, Andrea Faulds , lauri.kentta@gmail.com Message-ID: <08917a1e-1c4b-a952-3900-adf112508b02@fleshgrinder.com> Date: Fri, 11 Nov 2016 19:25:01 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-ACL-Warn: X-DNSBL-BARRACUDACENTRAL Subject: Re: [PHP-DEV] [RFC] Interval Comparison From: php@fleshgrinder.com (Fleshgrinder) On 11/11/2016 6:03 PM, David Walker wrote: > I took a quick stab at implementing, and had something working for constant > expressions, but handling something akin to: > > $a = 2; > if (1 < $a++ < 3) { > ... > } > > Is a bit awkward in our expansions of : if (1 < $a++ && $a++ < 3). Seems > as if when processing the chain here, you'd need to see if the left node > has a child, and somehow ensure you get the evaluated value somehow, to > override the "left" node. So logically expansion of the above would be if > (1 < $a++ && 3 < 3). I think the same would have too somehow handle > (either by syntax error or something) that if a non-numeric value creeps > into a binary-op-compare we error like: if (1 < (2==3) < 3). > > Just some food for thought > -- > Dave > Nice :) Personally I would make all of these situations parse errors. These are hard to read and understand code constructs, why would we want to support them in the first place? -- Richard "Fleshgrinder" Fussenegger