Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111149 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 17185 invoked from network); 23 Jul 2020 13:32:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Jul 2020 13:32:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 22FAC18050A for ; Thu, 23 Jul 2020 05:26:49 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 23 Jul 2020 05:26:48 -0700 (PDT) Received: by mail-lj1-f170.google.com with SMTP id x9so6120773ljc.5 for ; Thu, 23 Jul 2020 05:26:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=3EDX6i4EU/8X5kCXcPBu9EudVICxosqrJAz6wZV/L7I=; b=bOZWxcluB/W3di4tBn8kQRt09d+cZtFXe7mqepAgXkEeNzjCA7PhUvIFVt/HGhkgK3 +a5TJOKcB7t8SmBHLLFOqz+xgbzOCtddJx+5Iknl3/fYahJ7PVqDdgaUIk002fd3OVXs U/vUP6UPShjI2cEKRQ13iiMBCLRZob2EfoPXvKwa4inx+veTB2Z90eXRWZ/uM9Qkmrqb 6F4GCarM1P4jmqyn2oG4Jbu8d1O4upwWBwQd+XRwD7ZTUoFpwV0XAcZwbOtzv2byJp2b pDnStwYJtvOgoXWUvMGXpBiDMM5b1BDInjwyQkKGGOZP494ZifLXvmvHbL6lKbFeUfCp hBng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=3EDX6i4EU/8X5kCXcPBu9EudVICxosqrJAz6wZV/L7I=; b=Fugj3dci/7aqYS8HtcTZroCrJbjjGREJpgXPCoKGMr7mVdTS8T8nDJLs1hr0EzyVDi RUp5KBMwxehWlMKnNT8P5WKCxh9WKrFT/P5l7mZ4OOMYqJi8CyKXAANv+eb0YSJKLnXJ n0734pWF8LMhUcj8q64A5rsW4fiDg/Q2DyfTYRy7B6KQ6rK6sSrkqafFJTX5l7QxhAUp F21M8uZrD3bmpM33HZneAk7mRhZVND+A8PoGVEjK/C6abDbHg2yKonQyFyrpo/OjRKeo a4JEVYpkmWD70lVR7Y9RkZcWyXftjErehyRvaf2sCJuLJr+/tPsYmGLeHW8SaTtPtpio Hu4w== X-Gm-Message-State: AOAM533qtKJdbC2Y++RcSegY4q/9achlKT9zuR/Xz8WYFtceu4oMuXxb KvLB/psp6ELHpOYufyLJ1QxoBI1jhpLOhFmgVdEC6VnvmWM= X-Google-Smtp-Source: ABdhPJzXZ2L4u5fCtHmjDWSA0oaAgG3Pg2gnY5WM3r/obHxPuehUWnSl2Fx5bmMC3nvKNOTZm94eCK1Ju9ah9ng/4ec= X-Received: by 2002:a05:651c:1a7:: with SMTP id c7mr1999701ljn.345.1595507205608; Thu, 23 Jul 2020 05:26:45 -0700 (PDT) MIME-Version: 1.0 Date: Thu, 23 Jul 2020 14:26:29 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000003a17d305ab1af827" Subject: Ternary associativity From: nikita.ppv@gmail.com (Nikita Popov) --0000000000003a17d305ab1af827 Content-Type: text/plain; charset="UTF-8" Hi internals, 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. 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). 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. Any thoughts on that? Regards, Nikita --0000000000003a17d305ab1af827--