Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111320 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 81759 invoked from network); 4 Aug 2020 15:31:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Aug 2020 15:31:21 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 557B71804DB for ; Tue, 4 Aug 2020 07:29:03 -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=-1.9 required=5.0 tests=BAYES_00,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-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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, 4 Aug 2020 07:29:02 -0700 (PDT) Received: by mail-wm1-f42.google.com with SMTP id p14so2879137wmg.1 for ; Tue, 04 Aug 2020 07:29:02 -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=IXDCHEjJWtgjXqdnRQHpw3oqBm0YzeINWfOLuLG1QZ0=; b=zKq7oU3HjOOT/XsEf+x6ohjJhf3yd+Tkk2m2grIQt/fLMCnZqVCiLgWGuVcMRyhFqT o/5ViNeDw3UyCMaGVhmkJ6PIGezrJUuukGMRSmIh1wY+nYYXm6GxR83WCjizJ1x2NVTd Tj1QpfLAs39PO0/Y1z48jWLR4SnLqNsOrUiFyKZrItVGZyL9peUFUkLk9MEORyA58gH/ kXp6q5iLrUgd7a/Olyg82FqRhIBdt+/uicjrxp1sZ74ep9IPCBzSSmC4L2JGmvKjB9TI HQbaRQCKUoZHI/xkZNqLn+RDc52st6LVp9lmqh2kIZI7GlIwqSa74jZKr6doe4rKFpnO +wJA== 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=IXDCHEjJWtgjXqdnRQHpw3oqBm0YzeINWfOLuLG1QZ0=; b=eZNeNZPf9N55qtHkfO66UlZzEO/nl+1Y8oiNVQ7QcFvSrXw1ba5tWRcDO0t3AU3LyR 9Ja81mSjJTcKg7a+PebX0z4pt8Rni92lveSD7fK0F/GR1+XlXEgFz7CXw8cLpnl7W03+ TnUP9MIMi/XnDDb8Ak7fYUXWI6IHAKA5S544046Uj2wE/A3QQKTLJZrfm0xpB1Ting/w 6IQGi9NPZfA/dyHKp0AZzx2ucFtV7uWPAIziUFvUm+/NHmkmYTgBTOF1+KK577YR7sGo WAB79E31L5b0nXdDea+jvCLTMV1uw5GRZDZUKKSkNGe0Cuzx05Xs1/F3ASYZ7TqmxEI5 +4wQ== X-Gm-Message-State: AOAM5311qfVyBaVzcyXrrb/9rJxyGSnaYrtk3vnAyRGS2Crq2LpYfhGV zkmU5vARKF4gpm5wk+chKRDGNjKvKOCzb2W/KzCMJw== X-Google-Smtp-Source: ABdhPJx+acnj5ScLH+sOCmK+3arO1PZJb1eoguGj47CWtQV93i9CU9WR386gic06LagvS2GkiishqTj9qb/iPMEzSTk= X-Received: by 2002:a05:600c:410b:: with SMTP id j11mr4585644wmi.38.1596551339765; Tue, 04 Aug 2020 07:28:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 4 Aug 2020 16:28:48 +0200 Message-ID: To: David Rodrigues Cc: Derick Rethans , PHP Developers Mailing List Content-Type: multipart/alternative; boundary="000000000000790c3b05ac0e1360" Subject: Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2 From: kontakt@beberlei.de (Benjamin Eberlei) --000000000000790c3b05ac0e1360 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Aug 4, 2020 at 4:19 PM David Rodrigues wrote: > Suggestions: > > $(Attribute()) (available) > $[Attribute()] (available) > <> 2)>> (like strings escapes) > I had someone else suggest $[] to me today as well, funny coincidence :-) Can you take the "@@ to @[] pull" request as a starting point to try if this works with a patch? https://github.com/php/php-src/pull/5928 This syntax is "not" familiar with docblock usage of @, as it doesn't contain a @ :-D It does pose difficulty for static analyers and userland parsers, because they see the $ as a T_VARIABLE in PHP 7. > About $() syntax: > > - Number of required characters: (2+1) > - Has end delimiter: yes > - Allow grouping: yes > - Forward compatibility in PHP 7: yes > - Breaks BC of valid PHP 7 codes: no > - Used by other languages: no? > - Familiar with Docblock Usage: I don't know > - Difficulties with Userland Parsers: I don't know > > And my another suggestion is use a more verbose for now, until we have a > good consensus about it "using attribute()": > > > - Number of required characters: (16+1) > > > - Has end delimiter: yes > > > - Allow grouping: yes > > > - Forward compatibility in PHP 7: yes > > > - Breaks BC of valid PHP 7 codes: no > > > - Used by other languages: no? > > > - Familiar with Docblock Usage: I don't know > > > - Difficulties with Userland Parsers: I don't know > > This would definitely need a fully working patch to be a contender in the vote. - It's not forward compatibltle with PHP 7, because use of the syntax would lead to a fatal error on PHP 7 parsers or am I seeing something wrong? - its not a familiar syntax for PHP developers used to @ in docblocks > > Atenciosamente, > David Rodrigues > > > Em ter., 4 de ago. de 2020 =C3=A0s 11:03, Benjamin Eberlei > escreveu: > >> On Tue, Aug 4, 2020 at 3:46 PM Derick Rethans wrote: >> >> > Hi, >> > >> > Out of Banjamin's suggestion[1], I've updated the Shorter Attribute >> > Syntax Change RFC to reflect that process: >> > >> > https://wiki.php.net/rfc/shorter_attribute_syntax_change >> > >> > Patches and comments welcome. >> > >> > FWIW, this has an excemption from the RM Sara as per [2]: >> > >> > > * Shorter Attribute Syntax Change >> > > - Joe/Derick - Please make sure this RFC moves along and reaches >> > > conclusion by beta3, as discussed previously. >> > >> >> In combination to the existing proposals we already voted one, this RFC >> includes a fourth option that has not been discussed before, >> and could be the compromise we are all looking for :-) >> >> @[Attr] combines both the with to use the familiar @ of many, and the wi= sh >> to have a closing symbol/termination symbol that many others have. >> >> It does not have the downsides that Tyson found w.r.t. to #[Attr] being >> interpreted as comment on PHP 7, but that also means its not forward >> compatible like #[Attr] is. >> >> It provides a small BC break where code written as @[$foo, $bar] =3D baz= (); >> or $foo =3D @["bar" =3D> $baz]; will not compile on PHP 8 anymore, but t= hat >> can >> be easily >> fixed by writing it with a space between @ and [. >> >> >> > >> > cheers, >> > Derick >> > >> > [1] https://externals.io/message/111218#111261 >> > [2] https://externals.io/message/111286#111286 >> > >> > -- >> > PHP 7.4 Release Manager >> > Host of PHP Internals News: https://phpinternals.news >> > Like Xdebug? Consider supporting me: https://xdebug.org/support >> > https://derickrethans.nl | https://xdebug.org | https://dram.io >> > twitter: @derickr and @xdebug >> > >> > -- >> > PHP Internals - PHP Runtime Development Mailing List >> > To unsubscribe, visit: https://www.php.net/unsub.php >> > >> > >> > --000000000000790c3b05ac0e1360--