Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111498 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51077 invoked from network); 12 Aug 2020 20:44:10 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Aug 2020 20:44:10 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E59B4180532 for ; Wed, 12 Aug 2020 12:43:53 -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, 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 ; Wed, 12 Aug 2020 12:43:53 -0700 (PDT) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 4BRg9z4lHZz62PP for ; Wed, 12 Aug 2020 21:43:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=givoni.dk; s=unoeuro; t=1597261431; bh=HMxdcIlis8+qudu6rQISWcJCalYnk0CckvAQSt0jmIw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=G99oGSH/WOrvJALG0faJeLEiwxr+8Vm7nEpCnNST5PwasoGjIYRmn2Q9nJZ7WZ+2z z5gakBDuo0NiD25En5LH/a3fbVZTKErL8NhQgZ56JDIOxuoYS1VnOja3kSanlJrb1g GJEyU3UNOsze3/15/0Ged58/jxpKeLdNKtTdUZlU= Received: by mail-wr1-f45.google.com with SMTP id l2so3132729wrc.7 for ; Wed, 12 Aug 2020 12:43:51 -0700 (PDT) X-Gm-Message-State: AOAM531mgd+icq4D5Kc/iZAcMJIc2biiL4PMgBOMogwO+11zykTIecu9 7PPFEfU3zfdZ0SfbvSI6RhrOeZtYbxSK602H8H4= X-Google-Smtp-Source: ABdhPJyXjsEnYdSg5hKRHH3rEdhfFaNzNhPTuD+AIBiCdfwp7mIih//8hDn3y7C6hbn0qa++9lEAY5n6XWz/cySGm2s= X-Received: by 2002:adf:9125:: with SMTP id j34mr742533wrj.157.1597261431258; Wed, 12 Aug 2020 12:43:51 -0700 (PDT) MIME-Version: 1.0 References: <98192A9B-C5AF-4767-A300-77ED224BF1D6@gmail.com> In-Reply-To: <98192A9B-C5AF-4767-A300-77ED224BF1D6@gmail.com> Date: Wed, 12 Aug 2020 21:43:40 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Rowan Tommins Cc: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [VOTE] Shorter Attribute Syntax Change From: jakob@givoni.dk (Jakob Givoni) On Wed, Aug 12, 2020 at 9:08 PM Rowan Tommins wrote: > > On 12 August 2020 19:03:02 BST, Jakob Givoni wrote: > >> > Is > >> > > >> > > >> > > >> > on it's own an error? > >> > >> Yes. Basically this is an example of valid code in PHP 7 that will > >> break if @[] is adopted. > > > >Wow, that was unexpected. By what logic? > >Also, how long must I wait before I can put a semicolon after the new > >attribute syntax? Is one whitespace enough or do I have to go to a new > >line? > >To me, suddenly disallowing semicolons at some points between > >statements or between a "declaration" and a statement seems to break > >PHP logic. > > > It's not that the semicolon is forbidden as such, it's that the code is interpreted completely differently. > > Imagine if we had no "private" keyword, and then added it; this would previously have been valid (a statement followed by a declaration): > > private; function foo () {} Ok, that's starting to make sense. Having seen so many attribute examples lately I started to get the impression that you could basically insert them anywhere (like comments) - even if it didn't technically make any sense... Reading the original RFC again I understand that an attribute MUST be directly followed by a function, class, interface, traits, class constant, class property, class method, function/method parameter, a docblock or another attribute. I hope I didn't forget anything... Sorry, I'm just a sucker for details and accuracy :-) Thanks, Jakob