Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111183 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3299 invoked from network); 25 Jul 2020 16:31:17 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Jul 2020 16:31:17 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 483171804C8 for ; Sat, 25 Jul 2020 08:26:29 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,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-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (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 ; Sat, 25 Jul 2020 08:26:28 -0700 (PDT) Received: by mail-qk1-f178.google.com with SMTP id d14so11446946qke.13 for ; Sat, 25 Jul 2020 08:26:28 -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 :cc; bh=4+6KsECPrXFRdYXmEa4j+YEDef6dM0nHNYiYTYWUjRk=; b=NUYeSmeqdOJZFsnCK+cEZ0MTG9PKxsXS73ixrwlkHfvQG8iHpcxijmhL10pgGm7v/U RtdaM0ei8z0DqQLJBtZCQcgkymEcG1UI0LVmNm/9nx+ZUYO7tnorR53maOOcntPDs8TF XozyIKlMQfgOGPephWUotfNYXSule+aS1VYcr97Ewxag3HEQfjfTnQm3FbRocuL3Ionx puyWDdeLLQVlZXUhk6kzgRX2PelGTKvnHLljTY7ASYqdqE7enH6e1D6VwKMQoDUquQwT s6ZRxNIzcletyXv8N71l37/mF+N6ITCsXr25gM+HmdlnJ/S+hmD3ceG7O5CRw6obSR+f vTIA== 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:cc; bh=4+6KsECPrXFRdYXmEa4j+YEDef6dM0nHNYiYTYWUjRk=; b=hMgOFYPPinqQQpDiUH/jBxgXRb/swEy9pxJ74XtovFlLoE0MoaipPfPumeuqCwY/ie Pa0cfOL9Su8WYWf+kuRkPTn7km7vHowO18RPWAaSZXEZt9b6kXFBYzLIb9cAbarQCJvy /xzKEXA4Dq44g91e9ppoa4qpY1pu8/s322GSHU0sI5E6lQDr1CHyoAAVQQK5HIFBoBiB WtKFQ6j5EzBYZyeWvCrJqkNcUddNY0gAhXuirhjAMsqy3tzbDyaGpV+GuMK5z6i9S4Yj +0nmPuM7QzLj8qc0actuELD6dOrma4XTSQ8/VZF0cE1EdLsndwqqyuHdSkdxgaAcQGNI PKFA== X-Gm-Message-State: AOAM530Hl3zfvnED6CFcqrsnrEmxMBLW4gfPG20CGWHKqjV+BKEroxw9 gum+5l3oebPK5lzwF332JVqWOFVzumOqUmwgoyQ= X-Google-Smtp-Source: ABdhPJy1q7iVAhZ0NYjYPA1fa+JmbAqnVnXNYeoI1K2qa9b68uATUdtTB+HbUtCKReznhbCrq2qsbETU+oib368m6+Q= X-Received: by 2002:a37:b384:: with SMTP id c126mr12485447qkf.96.1595690786267; Sat, 25 Jul 2020 08:26:26 -0700 (PDT) MIME-Version: 1.0 References: <36d212ae-f5ef-9577-4077-ec43cfa8856d@gmail.com> In-Reply-To: <36d212ae-f5ef-9577-4077-ec43cfa8856d@gmail.com> Date: Sat, 25 Jul 2020 09:26:09 -0600 Message-ID: To: Rowan Tommins Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Ternary associativity From: cja987@gmail.com (Chuck Adams) On Fri, Jul 24, 2020 at 1:32 PM Rowan Tommins wrote: > If anything, I would argue for making both of these into errors, if > that's possible. I think the biggest risk with this kind of change is > not existing code relying on the old behaviour, it is code relying on > the *new* behaviour which is accidentally run on older versions of PHP. I thought the proposal to turn unparenthesized use into a warning then waiting for PHP9 to use the proper precedence was the right idea. Nested ternaries with the proper precedence turn into lovely truth tables, which isn't even an uncommon idiom in C. I'd really not like to feed /r/lolphp ammo by requiring the parens in all cases and continuing to break the ternary operator in comparison with every other language that has it. --c