Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105366 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5097 invoked from network); 24 Apr 2019 12:10:14 -0000 Received: from unknown (HELO v-smtpout2.han.skanova.net) (81.236.60.155) by pb1.pair.com with SMTP; 24 Apr 2019 12:10:14 -0000 Received: from [192.168.8.9] ([94.254.95.82]) by cmsmtp with ESMTPA id JDvVhUD0tEqdOJDvVhmQeW; Wed, 24 Apr 2019 11:10:49 +0200 To: Nikita Popov References: Cc: PHP internals Message-ID: <127542bd-74a4-e4f4-e05b-ac16876a58ea@telia.com> Date: Wed, 24 Apr 2019 11:10:53 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-CMAE-Envelope: MS4wfM7vBbxe4I/3kOYbnTowJ91WZx/YTMfRmF6fg19o+BUhSsjlpqgGR279eUJdCduZg4Iq8C/z9nDahYH+2an50N4fECsnt3VaURo9jPDJX8q8HsbsKLiW /42B7jGvF4FRPUNTnA/GV4XRLXMq7ZBcxBa5JvU8Sbx4RUZPq/XPNvAOQHmB2AQF4IwZ4yFJyH+Kc2nZqsDkiwOY0fubvSbEKyc= Subject: Re: [PHP-DEV] Re: [RFC] Deprecate left-associative ternary operator From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2019-04-22 kl. 10:09, skrev Nikita Popov: > On Tue, Apr 9, 2019 at 11:54 AM Nikita Popov wrote: > >> Hi internals, >> The only objection here came from Gabriel, and I don't think we'll come to >> an agreement. >> Inspired by Bob's recent RFC for concat precedence, I'd like to propose a >> deprecation and removal of the left-associative behavior of ternaries. >> Instead, explicit parentheses should be used: >> >> https://wiki.php.net/rfc/ternary_The only objection here came from >> Gabriel, and I don't think we'll come to an agreement.associativity >> >> >> This RFC makes nested ternaries without disambiguating parentheses an >> error in PHP 8 -- we might want to consider making them right-associative >> instead, which is both useful and matches the behavior of other languages. >> >> Regards, >> Nikita >> > Heads up: Plan to start voting tomorrow. > > Apart from Bishop, would anyone else prefer to directly go to right > associativity in PHP 8 rather than making it an error? I'm rather partial > to that myself, maybe it can be included as a voting option... > > Nikita Hi, I think one should go for the right associativity. 8.x is the right place to do it, if at all. Doing it directly in 8.0 has the benefit that when upgrading to a major version it justifies an upgrading project for an application and one also might get tool support, e.g. the php7mar tool for 7.0 was quite valuable. Also IDEs like phpstorm has good support. One then has to weigh legacy code versus new code being written with a behaviour different from almost all other languages. I'm not sure if this is an appropriate example to compare with, but I came to think on the PHP 7.0 Uniform Variable Syntax rfc regarding migration effort and BC impact. r//Björn L