Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111551 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14614 invoked from network); 16 Aug 2020 09:38:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Aug 2020 09:38:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2D1FA1804AC for ; Sun, 16 Aug 2020 01:39:11 -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,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from smtp.simply.com (smtp.simply.com [94.231.106.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 16 Aug 2020 01:39:10 -0700 (PDT) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by smtp.simply.com (Simply.com) with ESMTPSA id 4BTrF91jHGz616l for ; Sun, 16 Aug 2020 10:39:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=givoni.dk; s=unoeuro; t=1597567149; bh=/TCzSJgMX7I4ogu6JZY2otYlkYf6HNTY/RWQxjqjiYs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=LN4Yalf3TGvMSsijylUi7wrva27QCIyNYZP0hkB7/ODNGS7fTjegC2wULgC7h3h2g lrykQXkqRI0BDcofNyncsXYdrqKn17Z6osTvWPUTFYRX/JfZX62onAOtOg1V0e3adj gZLV/Zd4lCA3RKRtjJt8q3TLPqHZ3mLrnJK2LsNs= Received: by mail-wm1-f46.google.com with SMTP id g8so10833662wmk.3 for ; Sun, 16 Aug 2020 01:39:09 -0700 (PDT) X-Gm-Message-State: AOAM530wkQ+SClY5P1SEfPxvrmdlHFU4fSQkU2yH1cjIRZcBoJWQoTKX ne3bBqX6FmxRZuDnDYo/ME1msusKigUBcoyDckE= X-Google-Smtp-Source: ABdhPJyUFMcx/WdWHJhV9/3hT++idD8mUMjDtHYVoG0SMJeD7a1S/1UlNCILJpEd9cAuSQ8vBYRZNoAMjGgvvz+V218= X-Received: by 2002:a05:600c:22c8:: with SMTP id 8mr9263976wmg.143.1597567148833; Sun, 16 Aug 2020 01:39:08 -0700 (PDT) MIME-Version: 1.0 References: <5cc837df-ab47-628a-d29b-46d7933be973@gmx.net> <3A7CECC3-CDEE-4852-BF4B-4EC7CA1BD538@pmjones.io> <7d6c42a4-53cd-5e38-4ffc-02fe490d66a3@gmx.net> In-Reply-To: Date: Sun, 16 Aug 2020 10:38:57 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Benjamin Eberlei Cc: Benjamin Morel , =?UTF-8?B?TWljaGFlbCBWb8WZw63FoWVrIC0gxIxWVVQgRkVM?= , PHP Internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [VOTE] Shorter Attribute Syntax Change From: jakob@givoni.dk (Jakob Givoni) On Sun, Aug 16, 2020 at 1:00 AM Benjamin Eberlei wrot= e: >> >> The RFC says that >> > The main concern is that @@ has no ending symbol and it's inconsistent= with the language >> > that it would be the only declaration or statement in the whole langua= ge that has no ending termination symbol. >> However, it's clear that attributes are neither a declaration nor a >> statement, but metadata about the thing that follows them (unless it's >> more attributes or comments). >> The ultimate proof of this is that a semicolon after an attribute is ill= egal. > > I would like to chime in here since this argument is made over and over a= gain, even though it overlooks an important point. when we say that attribu= tes are just metadata, then let's compare them to docblocks with *are* alwa= ys enclosed in /** and */ instead of visibility keywords. > > This comparison is fair, because doc comments are often multi line and at= tributes are as well. When doc comments are single line, they are also encl= osed. > > Whereas a comparison with visibility modifiers that are *just* tokens tha= t *always* are followed by a T_WHITESPACE is apples vs oranges, because @@ = attributes can be followed by a large set of different things: > > @@Foo @@Bar // ends due to T_WHITESPACE with " " > @@Foo // ends due to T_WHITESPACE with "\n" > @@Foo() // ends due to ) > @@Foo () // ends with ), the T_WHITESPACE between class and arguments is= valid > @@Foo@@Bar // ends due to new T_ATTRIBUTE > @@Foo()@@Bar // ends due to ) > @@Foo > ("bar") // ends here in the second line at ) > function a_function() { > } > Hi Benjamin, I'm sorry, but I don't understand your argument. It's true that annotations used to be enclosed in a docblock, but that is not an argument for saying that attributes NEEDS to be enclosed in a block too. It's also true that attributes can be followed by many different things, but still it doesn't follow that block enclosing is NECESSARY. What I'm saying is that there is still no good argument for why attribute block syntax is better than non-block syntax. The only argument that was presented in the original RFC was not convincing, and I pointed out why. I'm also not saying that non-block syntax is better. Hence, it seems it's just a matter of taste, so far - unless we get to see some convincing arguments in the rewritten RFC. Thanks, Jakob