Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105222 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 91563 invoked from network); 10 Apr 2019 23:45:11 -0000 Received: from unknown (HELO mail-ed1-f67.google.com) (209.85.208.67) by pb1.pair.com with SMTP; 10 Apr 2019 23:45:11 -0000 Received: by mail-ed1-f67.google.com with SMTP id u57so2602107edm.3 for ; Wed, 10 Apr 2019 13:42:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=RRCY7eN+Q9RGXzWMeq//yIOHqZbjZ1zi97zDgTd8gVY=; b=UxMmM43gblLwnsP0tIMtdMBdR7X4/vIUnVtc5vXN7bZX3aFPuDPvPQq7SJziJSwCPN t/e+nLZ42pCUiH3HmlhfU+RhBEI5nOyzPq2S2XbKrzdurNwYl+QRIWycxfeybsZ1VLVh Sc2n0MNO//D+YN94dzXbRGIsRu7kzGMDTb0Z5vTWSMkoltxICBcQRxNy+FZBr+fLL9kd w83V9yzkHvN4bwrnKLXUGpoB1nAvjGUL5AnNnyEfMAVnGAYZwRtss7ooiaEFtyO3gcK1 nDvF2guaF655ZSMwdAS1HoPnPWSwo4v2ICoizqPOR4Jg6PiCbXLkuPlKki5GAtm2ebAb 6Mdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=RRCY7eN+Q9RGXzWMeq//yIOHqZbjZ1zi97zDgTd8gVY=; b=l0tQ4wiUCfMpK+QPGauLncHFWlquodIVMuMgJMeG8sn+DKKvCDtgUjLNSkVHkNIz/7 JBRSxK99clVnY3pIoF0hdEax1QlB/QFI9+EX//teLFA7ThbSttPn9yOd1UiwWaDaaysl s2Aa6CtN/6xfgUMXDcwuR9wERsxRLehlev9RQUWTyCwBAUhgKmJejJAaMtER/0lmwO17 IaEUoiPqBY2hF/aXveJHjHN6yLMIlwQxM0s2iVFu92YcKlBUJwU/UGA8J2rQ3rj9v49N q2clI9iIqhA1J4r3iCIj2Txv+KAXrPpUttMJehDLILHASy5TGBnlNqU+sQC/mSkDlmRb ZFbA== X-Gm-Message-State: APjAAAVlL8aYsynvu9Jl5u6XPp9HuEo7exURnbHNnTom2X8l2GsuVtO3 rMpzxnNOyl3YM/HYFpJ77Y0zBobO X-Google-Smtp-Source: APXvYqz/UQJn/2sofrN2Hc+adZiRldnRSg+zXv6Cf2aI9kggTuoBe0OKJDKjRGy4629OegFqyU9szA== X-Received: by 2002:a17:906:55c4:: with SMTP id z4mr25373384ejp.128.1554928944006; Wed, 10 Apr 2019 13:42:24 -0700 (PDT) Received: from [10.6.216.53] (164.235.197.178.dynamic.wless.lssmb00p-cgnat.res.cust.swisscom.ch. [178.197.235.164]) by smtp.gmail.com with ESMTPSA id cg22sm6711564ejb.2.2019.04.10.13.42.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 13:42:23 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) X-Mailer: iPhone Mail (16D57) In-Reply-To: <010a5e8c-3614-6263-2553-b53b88be1273@gmail.com> Date: Wed, 10 Apr 2019 22:42:21 +0200 Cc: Nikita Popov , PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <010a5e8c-3614-6263-2553-b53b88be1273@gmail.com> To: Stanislav Malyshev Subject: Re: [PHP-DEV] [RFC] Deprecate left-associative ternary operator From: claude.pache@gmail.com (Claude Pache) > Le 10 avr. 2019 =C3=A0 21:21, Stanislav Malyshev a =C3= =A9crit : >=20 > Hi! >=20 >> 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: >>=20 >> https://wiki.php.net/rfc/ternary_associativity >=20 > Please, let's not mess with language syntax and require people to > rewrite their code just because suddenly after 20 years of existence in > the language we feel maybe the precedence should be different. I > literally can't think of a single case where it would improve anyone's > life in any substantial way. I bet that more than one developer has once written , and later has wasted a nontrivial amount of time i= n order to understand why they got some wrong result. So, definitely, making= that trap a syntax error is a real tangible improvement of the language.=20= > If you wanted to use parentheses, you can > do it now - you can even have it enforced by code analyzer if you wish > so, in your private code base. A language that requires their users to use a code analyser (or to read the m= anual thoroughly before starting to code) in order to keep their sanity, wel= l, ... has a problem.=20 =20 > But I can easily imagine dealing with > tons of deprecation warnings (which usually break CI unit tests and > wreak general havoc) or even worse, useless errors, in existing code, > which would become broken for no reason As I can=E2=80=99t imagine a case where someone would have taken advantage o= f the current left-associativity semantics, I can=E2=80=99t imagine either s= omeone dealing with =E2=80=9Ca ton of deprecation warnings=E2=80=9D because o= f that. But TBH, my imagination is sometimes very selective. However, what I= can imagine, is that hidden bugs will be revealed as a side-effect of those= deprecation warnings, and time will be taken to understand and correct them= .=20 =E2=80=94Claude > but... honestly, I don't even > know how to finish this phrase, I can't even think of a single reason I > could explain to anybody why their code would no longer work in 8.0. >=20 > I understand 8.0 is a good target for breaking things. But that doesn't > mean we have to do it as much as possible. >=20 > And this absolutely doesn't mean we need to get 7.4 to break things (and > yes, deprecation warning is breaking things, in most cases). > --=20 > Stas Malyshev > smalyshev@gmail.com >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20