Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110362 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 81992 invoked from network); 4 Jun 2020 11:54:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Jun 2020 11:54:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 923831804CE for ; Thu, 4 Jun 2020 03:37:22 -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, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) (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, 4 Jun 2020 03:37:22 -0700 (PDT) Received: by mail-yb1-f180.google.com with SMTP id n5so2686805ybo.7 for ; Thu, 04 Jun 2020 03:37:22 -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=mJ8k5toZk8BshPieDkY7mURcat3CnId0ftfgPgjJ2bI=; b=QWJqKdmrk140rs1mqNZfinayHi7atGgG0Rl+F4rjO4gQqCuuKXzjAXxDcWmRhiImVA gpaQQUgcNCkbTymLu5+pdi2EByw9BO2WuxQ+Tvuw25Gj+xn/1UAQkaTkAbBxIaGKt7+J iKqBYAMkHckZDjT6sw1sKT/esZ9gar8/VxtldNKMsN7RpFUgRiDr2icoZfXyU1kYPyno eB5J4aHgNhQxARKfKKT/8IuAocscOtblBICR+A5I1wcc8T+0dBrAgx2rcpLppPLv/6sn XtuSJfEfvmE9N1imBBdkZxsxEdPX8A1b7bI3TaEbg25fTEjuIqCj0DhUF28lvN2bSAsL USow== 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=mJ8k5toZk8BshPieDkY7mURcat3CnId0ftfgPgjJ2bI=; b=qRHRUXaHA9LQd9QjBrdPl59q2+VStr7cQnLgM3vSGqNWHsXE0xDJ89+sylaQoP8pOJ 59Yr1y6tt/06z/9/Nlm6/0EC9EbrtbWl/XLFzObuy49+mWFX5e3yVFfM9a3uQI/NrfAF oqXAvxmIbYsC+hmhZnH8PXhfH0eUKrGR7nSM5LBfd9cha/16hgDuDI4IYi6bVQVZhUCe CZQZ7LXLgRUeYBYppFm3v8Qe3ptFoHe0FAjuRet/x1tVa3kbu8oD+1UCnL7aOvmHQTnG STbyeS8hl2f0JQXqQrqJGRJhZaARyz2nkihymvy6rmL+nTBRjDpA97QA3b22HBR/Qniz Fscw== X-Gm-Message-State: AOAM530JGCIACI4jNIgX9FovUWIEbqWsKYb42rYWKMjKMGxUEVmmbklM Gzt9IPiI7RE4OurMVMPw1A9ZK4QGVN8GvK0ujO4U+rPD X-Google-Smtp-Source: ABdhPJwVoHa3LUiDXguYqxumMH3fPkkLG/Eq3TUnitoBD+VKdCr6AU/4s/Gs7TfmoFM8/Q5o/JSKH/T/cAEBpZCZOw4= X-Received: by 2002:a25:6dd5:: with SMTP id i204mr7030313ybc.347.1591267041245; Thu, 04 Jun 2020 03:37:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 4 Jun 2020 12:37:10 +0200 Message-ID: To: internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Shorter attribute syntax From: tovilo.ilija@gmail.com (Ilija Tovilo) > > Does the PHP parser prevent us from adopting #[attr]? I presume C#'s [attr] > > syntax and C++'s [[attr]] are impossible due to PHP's short array syntax. > > yes, that would create ambiguity in the parser since `#` (just like `//`) > is for comments. I've mentioned this off-list before. If we consider @@ with a BC break we could also consider #[] by making #[ a symbol. This is also a breaking change but a probably similarly small one. It would break code like this: # Comments still work #[ <-- But they can't start with #[ To me both of those look acceptable but #[ looks nicer (but that's just my personal preference). Ilija