Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111240 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51268 invoked from network); 29 Jul 2020 02:16:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jul 2020 02:16:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C174A1804E6 for ; Tue, 28 Jul 2020 18:12:14 -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.5 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 ; Tue, 28 Jul 2020 18:12:13 -0700 (PDT) Received: by mail-wr1-f53.google.com with SMTP id z18so16433179wrm.12 for ; Tue, 28 Jul 2020 18:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2LOKY++3/kMQnt7rC2dGobCdrdQL/Eo814Sb+/FhvgQ=; b=vX0f4QxAtQH4cseD+lizMiwga0uRRSaAtpad3KFlj962zv5YKwp+rQlV+xkUaK1aNY gbk0C0atXdb02zdI+QgKy6lLyh1tWB8NQqQ1hkuEDN3S5oUsm2gDiyXxt+XVYcV1NaIc 09Y0vDx904vZOuHAalQ0a/GR7WPaHFGFJD1u9F/BdLCv3/RQIxJ33lossxPk+xrCVJdV SwWVFPBAQ4PBsX1NOE8SMhCBVJeFO6WizLod3ZDOJKjjg7MYBEn1A5pBYdJKXtvMgSuj zQApeCyz3ZwfZl8DSkkJQiCz3K2t/DyHxiITJcTkpTzgXVXQEMnN73CepkT9cWA0bHVE VbmQ== 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=2LOKY++3/kMQnt7rC2dGobCdrdQL/Eo814Sb+/FhvgQ=; b=pCckpwofm8afp/AyoGhmYAc09xh+Q+wZcf4g49twP9QDBbLtUcZ3BrCuczV0Fr2QhQ wxvShxOi6ZY6tDgJA9xFfCq0LIlxjWar92zmi8UzgZYKOUxoa0K67GV6WNT2fS/7wJ+B cMK3Bh5XaynNaIieuh4C0gIGzzsHabvTdFa4Dw07YaPJkV4rz4VhQVldQDlvfnWrqFKq 58UkA2/FzSHrWvzTv5fc8YylP9LpZ6mkDVzD2dIMRGWX/Ua7SUVK9Tj3cGUfopJKRrzN nM+gb3DJ97mhTJpEgkEUXYgQ+5wYq4KWgjHNnJnU3H87X36ZCUN5KYH3iZElA3I6NN3Q krWQ== X-Gm-Message-State: AOAM531zrU93AGWHiP5nvV+ABvyKQ/KQogO42CTM0qeI0x5FyMtCifyt 2WJQMax9iO4wAnCfTe1MwumB+jjQ2pnCaiCnmXGxCpxWuDk= X-Google-Smtp-Source: ABdhPJx6T/Lb4mquQbegAWEORlPdwDUbz7mtgg9GUfZvbpnLU4HHbzo7PAhR5P/p8zZ2qb3mbpRC4w+Mslmlk74cS0I= X-Received: by 2002:a5d:4008:: with SMTP id n8mr27622410wrp.255.1595985129857; Tue, 28 Jul 2020 18:12:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 29 Jul 2020 03:11:58 +0200 Message-ID: To: Joe Ferguson Cc: PHP Developers Mailing List Content-Type: multipart/alternative; boundary="000000000000bb778b05ab8a3ea2" Subject: Re: [PHP-DEV] [RFC] [Discussion] Shorter Attribute Syntax Change From: kontakt@beberlei.de (Benjamin Eberlei) --000000000000bb778b05ab8a3ea2 Content-Type: text/plain; charset="UTF-8" Hi Joe, Personally I favor #[] myself, but there has been a vote with a substantial participation choosing @@. Overturning this democratic outcome should require **significant** technical arguments, otherwise this RFC would provide problematic precedent for any RFC to be overturned by arbitrary revoting. The arguments the RFC brings forward don't convince me that we should pick #[] over @@. 1. The parser conflict was my major reason why @@ should not have been picked from a technical POV. But this issue has been fixed by an independent improvement since then. These kinds of small problems are found regularly after RFCs are accepted and are subsequently fixed. The RFC is formulated as the problem still exists, but it does not. Yes, the namespace token RFC vote has not yet finished, but there is no chance it will be rejected at this point. Since the namespace token RFC is passing, and I have seen the simplicity of the new parser rules, my opinion has changed to keep pushing for #[] and I accept the @@ outcome. 2. The phpcs argument also does not convince me. Summed up it is essentially that a current version of phpcs does not support parsing @@ or <<>> yet and incorrectly changes code using them, however for #[] it does nothing because it parses it as a comment. To me this sounds like a bug in PHPCS. This argument also breaks down completely on multi line attributes. Why should we even expect PHPCS to support an unreleased version? If someone uses PHP 8 code, why do we assume they keep using an old version of phpcs that does not support PHP 8 yet? 3. We already established that the syntax question is extremely contentious, and I was getting tons of messages on it on Twitter, Reddit, Email et al during the initial Attributes RFC. So of course people would be against @@ (as I am myself), however it had a majority in votes. For me putting these subjective opinions into the RFC makes the case for overturning less convincing, because it makes the argument that overturning a valid democratic vote is somehow OK if you are loud. The only reason why we change this outcome must be purely technical imho. 4. You cannot write a regex to detect the end symbols for both #[] or <<>>, because both end symbols are allowed *inside* the attribute syntax already, so it's not easier to find occurrences with regexes with the other syntaxes: #[Foo([1 => 2])] <> 4)>> Simple detection of attributes will always need to grep only for the start token, and both @@ and #[ are equally unique to find here. 5. For readability an end token would be nicer (which is why i prefer #[]). But this information was already known during the first vote on the syntax and rejected by majority. 6. An end token might indeed allow extending attributes with new stuff, but nobody has brought up this use-case before. No other language has additional attribute keywords, why is this brought as a positive argument, when the choice of syntax no other language uses is brought up as a negative point later? 7. Future potential parsing problems are brought forward for @@, but # being a comment token makes it likely that #[] will also cause problems. Tyson has a few examples in his email to this thread. Other confusing things you can do with #[] for example: #[Foo( 1 # 1 ] bar )] function foo () { } Which is #[Foo(1)] without comments and line breaks. --000000000000bb778b05ab8a3ea2--