Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:105166
Return-Path: <rowan.collins@gmail.com>
Delivered-To: mailing list internals@lists.php.net
Received: (qmail 93247 invoked from network); 9 Apr 2019 13:27:25 -0000
Received: from unknown (HELO mail-it1-f182.google.com) (209.85.166.182)
  by pb1.pair.com with SMTP; 9 Apr 2019 13:27:25 -0000
Received: by mail-it1-f182.google.com with SMTP id k64so3980533itb.5
        for <internals@lists.php.net>; Tue, 09 Apr 2019 03:24:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
        bh=NkzX2GqD5vAXUvOddT5og7/93RTv1dKROXanTj85PXk=;
        b=F9l/SlTUmbHJZRMijUPkPE9mIWJu1JlUOXSBmgQnROutsTj/d6VPP6MtpU541lMdZA
         C6EjomjVYrJuSg3er3FYcNXwHhMKPOX8rlseJR9RZ/MV0KZMWXtzDWYHQil5OQKHGvfe
         KkRr/1T9FKrruOc2C33+MtGpPiBaC636l0ZM6PeQnTvwvbbv1OdD79H9aCIGN1WldX9Z
         dXCzLTi3whxGKZ6WNLsl/fifxUwxF5BQrycm8cSkmAZuLT0cYcryk7rEpG3vEc2TD2v4
         QvJ3crq8UedQpCkWTx7WcwGU3L8mxlemzXdoCutBRr9uCwlbStMktjmsDBqZ82FZNV5q
         soLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to;
        bh=NkzX2GqD5vAXUvOddT5og7/93RTv1dKROXanTj85PXk=;
        b=By1waW3vVNBzZVH2p2clJlEgDoOuRIr7m49LWlh+AwrRJ5lXtFTjKz4ywLUAQOWG2Z
         wbtgAFKYgebgiiGughZgj7DPHq15KDjKltIQbfQ2cMA/zzPzPdcJJSCBfYzX7feS+FOr
         TVYFQRz8YFhVSVlKzTePsozFNdIl5IqmFf39BQUNvombPBvEeqV00mfs5hChddAxteov
         lYGkV4agDlHF2wS7WTW9//JJmyRr33JqyfPjjt48UJD8voW1ZhkeySQfIt8czIq2GNO9
         fmtkh3vsuM5t9PH7PJCJV9ns7Gz4sg0N5f62g6WKA3yAK+xz/XiWr1XBwzlllyQ4prYr
         8YVw==
X-Gm-Message-State: APjAAAVVWUUjR0KHAWQ8a1Y1mNMyEjisEvt96mKYHIPY/WxGUSzXGPt8
	PAc9jBakLFmaPiL59xnOuH5LYOzOV9OtG/j736Sihpi5
X-Google-Smtp-Source: APXvYqx7iaaf38ytDurKUb/sFLOxhAcCLY/0jY5XXBZ6/mtjbM8+549MvDWV3Nr/vkcaMKFgJLGNazX/2nousy47bfY=
X-Received: by 2002:a24:3a13:: with SMTP id m19mr23437132itm.88.1554805456735;
 Tue, 09 Apr 2019 03:24:16 -0700 (PDT)
MIME-Version: 1.0
References: <CAF+90c_DYFQ_7dXvHg-8DfVJ9zQT8xYfFObiJCLHFskFgqhJeQ@mail.gmail.com>
In-Reply-To: <CAF+90c_DYFQ_7dXvHg-8DfVJ9zQT8xYfFObiJCLHFskFgqhJeQ@mail.gmail.com>
Date: Tue, 9 Apr 2019 11:24:05 +0100
Message-ID: <CALKiJKqneYxOPH5gKKHj3SUr3zvjWCgBb_r1LiREEDZXZRhvZg@mail.gmail.com>
To: PHP internals <internals@lists.php.net>
Content-Type: multipart/alternative; boundary="000000000000f193770586165ac9"
Subject: Re: [PHP-DEV] [RFC] Deprecate left-associative ternary operator
From: rowan.collins@gmail.com (Rowan Collins)

--000000000000f193770586165ac9
Content-Type: text/plain; charset="UTF-8"

On Tue, 9 Apr 2019 at 10:54, Nikita Popov <nikita.ppv@gmail.com> wrote:

> Hi internals,
>
> 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_associativity
>


Thanks for putting this forward, it removes one more WTF from the language.
I think non-associativity is safest, because even if it's rarely desirable,
code may be out there that works accidentally with the current situation.
There's also the risk that someone would get used to it working one way in
PHP 8, and accidentally use it in code that's still deployed on PHP 7.

In both cases, it's better to generate an error and force users to be
explicit than introduce subtle bugs. We can then look at making it
right-associative in PHP 9, because anybody that needs to support 7, 8 and
9 can be explicit, and hopefully not many people will be jumping directly
between 7 and 9.

Regards,
-- 
Rowan Collins
[IMSoP]

--000000000000f193770586165ac9--