Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111162 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 93043 invoked from network); 24 Jul 2020 12:44:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Jul 2020 12:44:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E74F71804F2 for ; Fri, 24 Jul 2020 04:39:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from qq.com (out203-205-221-149.mail.qq.com [203.205.221.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 24 Jul 2020 04:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1595590745; bh=cvnQyLmMM+7P2/fWonsX9FSkeO4Nq8uwMgVKQJ6PEXo=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=hQCY4a8HCbiqhQefYzepJ4fN1sEJPAxVI+EJazmgHU5ur5Ja3LNKR2p/YsQglTsha zHuRcDh0cJANfkyhpn/OrQ28RrQGaFx0FyytOJfGWS2+JODuBbp6+GvPT8SjrUE+Ij 8348gprtyWokBpS2Aq7hI/4WXLwqWBlxdz/HFr2c= Received: from [192.168.0.100] ([111.198.231.42]) by newxmesmtplogicsvrszc8.qq.com (NewEsmtp) with SMTP id 9C38BA9B; Fri, 24 Jul 2020 19:39:03 +0800 X-QQ-mid: xmsmtpt1595590743tgyp9zhnh Message-ID: X-QQ-XMAILINFO: OfsSGjvqWbazy4Tgav4SWdjCULOHrLfGC7zSFoybAK4VC0eowDQbsD4ZQaBygz n9LxV3kC8lt6UKIZ/s7pgCUWH02aPRc9nyF+lKr0VMEiTKyNu79MgsJLFDesK6Up0TKp0gW5U5Ar Olfxe+Nd31kS5yCcq6Iv7XHJUh/U4fbrNqEQ9T5sBLFhrg6oPtFacINRg0l1GuhuinpfU2wjJKtY 4miB2XtkeSpI0mLd1nU8VBUXh8Ic16YlIyRHOzKynCY+IyS1cYMUv8V3s4YjgUmsQGbNId6IrN/j xhLIObyURds6B24gkv1QQ1xqrw1u8b5Tpjc8OT2GSq/nkfmULQR1G3r+aYweztbFJ0/ddCxZ+FjF ip/lbvHnXJxaPKRwIMWSLaBcSoPww2oBo6apIiPweZkr1Wl/W+lhYmk1ggevnxozhwT8q9lkvwxq lMlBmTByHkOkvZZGBVXIIYBbfjGAxNReBrIme2qEYOpCNICkl4NGyPl+ATiBK3zxr2iqhHPx/3pE TRniyrpkoKY2LannoP1CDsPa/i1XkIcHXNYdYWNBTMOT/VIVWDa1VTdRXOgcFJh5D5APjpZGT5jY n0Qf8Fw57FM8mdMm2FWGDCzw3ikaWqsz4vS137/xMXf0itsvVMZScg6EVwQcYhaNYa6e7FSscKtq BtGFAPAlPmkBCuJCFi87doIDyoFvBRm0ywsdhx2hwToAG00/ZWlyH38Fs= Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) In-Reply-To: Date: Fri, 24 Jul 2020 19:39:03 +0800 Cc: PHP internals Content-Transfer-Encoding: quoted-printable X-OQ-MSGID: References: To: Nikita Popov X-Mailer: Apple Mail (2.3608.80.23.2.2) Subject: Re: [PHP-DEV] Ternary associativity From: twose@qq.com (twosee) > 2020=E5=B9=B47=E6=9C=8823=E6=97=A5 =E4=B8=8B=E5=8D=888:26=EF=BC=8CNikita= Popov =E5=86=99=E9=81=93=EF=BC=9A >=20 > Hi internals, >=20 > PHP currently has an incorrect right-associative ternary operator. In > https://wiki.php.net/rfc/ternary_associativity the use of nested = ternaries > was deprecated, and was supposed to become an error in PHP 8.0. >=20 > Concurrently with that proposal > https://wiki.php.net/rfc/concatenation_precedence made a very similar > change to the concatenation operator precedence. The difference here = is > that this throws a deprecation notice in PHP 7.4 (same), but changes = the > behavior in PHP 8.0 (rather than making it an error). >=20 > This is a pretty nonsensical outcome, in that the same type of change = is > implemented in two different ways. I think it would be good to handle = the > ternary change the same way as the concatenation change, i.e. make > ternaries use the correct left-associative behavior in PHP 8.0, rather = than > throwing an error. >=20 > Any thoughts on that? >=20 > Regards, > Nikita I would rather both of them become errors It is evil to use associativity instead of explicit parentheses The evaluation results of these two RFCs are that the impact of these = changes should be minimal and it almost always is an error, so if we = want to make them consistent, why not make them all become errors? Regards, Twosee