Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105164 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89573 invoked from network); 9 Apr 2019 13:22:45 -0000 Received: from unknown (HELO mail-vk1-f180.google.com) (209.85.221.180) by pb1.pair.com with SMTP; 9 Apr 2019 13:22:45 -0000 Received: by mail-vk1-f180.google.com with SMTP id h127so3727934vkd.12 for ; Tue, 09 Apr 2019 03:19:37 -0700 (PDT) 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:reply-to :from:date:message-id:subject:to:cc; bh=BhUiXvqULkIdVPLUicSJmREHPPo/YNl3ZnvVrBV7m+A=; b=UvYKiHH8B9Mu7sM7iJZEv+C390MDN4Jxh258xNytv5WjTOThCz7O7OsI/b70wjXYGs +3bFDztWxrIPDPwZf5pYF1yzPNrbmppQccMgxetDZodeoZlKiY2y6RxdiClQebCDH/CN f2/KNqhy5VOyJyZDTO/0YsY1M1YTueGfh5Na0woSDi8CK9s+SyOFO/Hnki/3IQ8BoDIg YOGUvu5Pa3o0fxLWDgU5Vyl/txS93IMlvZVFSrn5i9ciiyQPDyHeKJz0zTZEyyEdJfhD aQbpacHro9K4ECPEvESqeF03J3stvGnU26lgwPPyGybM0zrF5cvLnPCWv1/zKXgSYYRK ZV9Q== X-Gm-Message-State: APjAAAVFWuHKOKIv7RTiix56OcHCeLLE/qM714BYSaXmAzk1WoGpFYSP Gurv8iTNBQkMQDzXKOpPQFXiUlkcYY/701Kzn4k= X-Google-Smtp-Source: APXvYqzsPwWI8duNcEVDo3e5iROIPOeqYjGCGSIbCPaRIMaHzkNbiWyY5+zFCXUhum+PUIJ96qBK3pcd505mABq1i6o= X-Received: by 2002:a1f:bf4b:: with SMTP id p72mr19403651vkf.77.1554805176433; Tue, 09 Apr 2019 03:19:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: bishop@php.net Date: Tue, 9 Apr 2019 06:19:11 -0400 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000003c81c60586164a77" Subject: Re: [PHP-DEV] [RFC] Deprecate left-associative ternary operator From: bishop@php.net (Bishop Bettini) --0000000000003c81c60586164a77 Content-Type: text/plain; charset="UTF-8" On Tue, Apr 9, 2019 at 5:54 AM Nikita Popov wrote: > > 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 > > This RFC makes nested ternaries without disambiguating parentheses an error > in PHP 8 -- we might want to consider making them right-associative > instead, which is both useful and matches the behavior of other languages. > I'd support mandatory disambiguation, though I feel we should go all in and introduce a ternary with right associativity. See also Bug 61915[1], which suggests leaving ? left and introducing ?? for right. Personally I don't see any benefit to keeping a ternary with left associativity. [1]: https://bugs.php.net/bug.php?id=61915 --0000000000003c81c60586164a77--