Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111497 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 47572 invoked from network); 12 Aug 2020 20:08:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Aug 2020 20:08:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1C3AC180548 for ; Wed, 12 Aug 2020 12:08:23 -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-Virus: No X-Envelope-From: Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 ; Wed, 12 Aug 2020 12:08:22 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id p20so3080058wrf.0 for ; Wed, 12 Aug 2020 12:08:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=JDeb8LPl7xRB/OGm6opRqq+PNEz0ioQQMLPSC0ht/jk=; b=BXwLSsB66y8PPIKTxJXRo59hEdpyApygc/9WmufjnFj2TJIQyoKtICQxKDyxe3Q25n vvm20Hz2Fd36ZGbQM123hZ+wmmos4nSdqgk9WQykr06gZ/oN3yRowDRL00oZFAyyKJtY rr1PNJmb54BW+OME34YNHkJI/Q0eY3MIiixaVn4iZoE2TuHHqjvngrspmW2wSJxFoLz9 kWK8u8L302goxYaFF61Vgy1LQ32lQzzfoSZkcNsX0pORcHTiVWCz927IVo8vQg42jN/S 8rnUhHZvISCCm39rTDC4RwzgkqIFMqeYWhq1YG8p8Oo8qoN8W/QLV1Qprahrzbe8KGMs juOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=JDeb8LPl7xRB/OGm6opRqq+PNEz0ioQQMLPSC0ht/jk=; b=rfZN/DjD3CfXdzVfyW044ln8bR9cV2I4RgqoyVYWweeQMMdiN2Ju69MI7OnvqfTPIk iHEojJsY1wuljkEAXIClm3pq40vLeztCNRwDAUFYqsqq0+NtvFz1oiiqEuYfMpIFs2Uf hwnHbq4ekmnMNndapJGqa5yyYPNiWh84EJIPR6kplH1WZISDkmuisA20RHfuPbwsZtW8 OESoRb2Rr9pzCfy5eNXBh48bxC2eCCqTpuLFd59+0Z5FsafxlyE4IQCMNqSrTjSxb8G5 ViSCDsWYaecXah+GxZ8d9ChQNMwwFbEynaPs0DKs4qDWhHRlI0puB7PTvmD8wbFEqR47 xeZw== X-Gm-Message-State: AOAM532TAEVP+ZM+HTEX2wxqoYMvSS1KXjc07Eabrx5+jdjR66uamEMT 5IIiBcQF0yo8OrNLi6tVE8f/D3Pi X-Google-Smtp-Source: ABdhPJya26dori1lsqvalgXezWMHOnWN63Fyec6M0l1ZRG+g4/KBhe2k2epjfBqFwL2RcWFtAm3dtg== X-Received: by 2002:a5d:6692:: with SMTP id l18mr553995wru.211.1597259298875; Wed, 12 Aug 2020 12:08:18 -0700 (PDT) Received: from [192.168.0.12] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.gmail.com with ESMTPSA id b2sm4849140wmj.47.2020.08.12.12.08.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Aug 2020 12:08:17 -0700 (PDT) Date: Wed, 12 Aug 2020 20:08:18 +0100 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: internals@lists.php.net Message-ID: <98192A9B-C5AF-4767-A300-77ED224BF1D6@gmail.com> Subject: Re: [PHP-DEV] [VOTE] Shorter Attribute Syntax Change From: rowan.collins@gmail.com (Rowan Tommins) On 12 August 2020 19:03:02 BST, Jakob Givoni wrote: >> > Is >> > >> > >> > >> > on it's own an error? >> >> Yes=2E Basically this is an example of valid code in PHP 7 that will >> break if @[] is adopted=2E > >Wow, that was unexpected=2E 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=2E It's not that the semicolon is forbidden as such, it's that the code is in= terpreted completely differently=2E Imagine if we had no "private" keyword, and then added it; this would prev= iously have been valid (a statement followed by a declaration): private; function foo () {} But once "private" is a keyword, that is a syntax error=2E Removing the semicolon happens to make a valid declaration using the keywo= rd, but that's basically coincidence: private function foo() {} The same is true of attributes, which as others have pointed out are simil= ar to visibility or scope modifiers - anywhere that could be an attribute w= ill be parsed as one, not as a statement, comment, or whatever else, so som= e code changes meaning, and other code becomes a syntax error=2E Regards, --=20 Rowan Tommins [IMSoP]