Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110460 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 93657 invoked from network); 10 Jun 2020 09:27:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Jun 2020 09:27:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B70E11804F8 for ; Wed, 10 Jun 2020 01:11:43 -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,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (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, 10 Jun 2020 01:11:43 -0700 (PDT) Received: by mail-oi1-f171.google.com with SMTP id j189so1275279oih.10 for ; Wed, 10 Jun 2020 01:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mP7EdN0YcYXWudeutdT/VjPj4PhxBsTX2RgBgwzLZoo=; b=OlmpffhpQoEW73/Nacq+myoEWNz42pR8/9s8lyc24fe6Gbvb1IxfcxlzdSceICXnF6 uIloi957qQlOniBVZ7PI3eBErRNJWT3dJ+yhwoysYWb277Vn1fDRXJfvAAmXEPO4m3C/ XoPhQdd5/034IzXeRtHWAbANOqXN/hSJhWModQozBNjbOusBSDVwFZHBGMeaXDJ1cNmu RHYssVYx5jSXykfi168Em9Ivr1DxRFBfQX3nkA4bQ3FfOCzaJT1WjS4bs8QdUIceh3l0 0ol2JUTzcjke4bS0/IUrrw1BC8y9b8BQZyuzLjclCw5bUfF8FejVjWkI/U66xQe4jLdI xs4A== 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=mP7EdN0YcYXWudeutdT/VjPj4PhxBsTX2RgBgwzLZoo=; b=ItrzqVbE4LU09XUJQ5fXeHQpb4bKYdgHbporiFg/Ij9dov0ChS+aCR8F6oOdXQ9eCL pIiERdFm8V/3llifp/le5Xjg8lDLgSyepT6eGHuqAesTOzeVsaxkqQ0dJsfy7G6acwU7 OM5tvCd7Idm3YKTftjwpJ8BUtO30tRCjdwCj4sGnDzEP9TDzU6gHRf28QLzxKOULzbyh O7E0fm1iR3YancG5UwTWUKcjlONtvOLjUlCh5P/bmk+60+Sz+Fh6qvznpj+6BsAsolFz mPO2txdOVmmumZM92NvLQjI1nOXylAwePvOeQSZyqzaV3PYN7VThYE22JxGZALiJyj1/ X5aQ== X-Gm-Message-State: AOAM533YXRK4DFei+DHYCylouDig6PZTqrGHW4R47wO4f/41zaF2KFZ8 b5NjHThE8dPTNst2Bn4b7gGRIhELZ2IxqN45bu0= X-Google-Smtp-Source: ABdhPJz6l1uIxwYnJMklRSsBlyorJ8tQbRxUphTBl376rM1Fdmh3q/T8VAjx4ijWu76F0o6hs2ElouvqIwh+9GGRVvg= X-Received: by 2002:aca:d956:: with SMTP id q83mr1549053oig.78.1591776701533; Wed, 10 Jun 2020 01:11:41 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 10 Jun 2020 10:11:30 +0200 Message-ID: To: Benjamin Eberlei Cc: Theodore Brown , Sara Golemon , carusogabriel34@gmail.com, internals Content-Type: multipart/alternative; boundary="000000000000db51b805a7b66453" Subject: Re: [PHP-DEV] [RFC] Shorter attribute syntax From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --000000000000db51b805a7b66453 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable wt., 9 cze 2020 o 13:56 Benjamin Eberlei napisa=C5=82= (a): > On Thu, Jun 4, 2020 at 1:55 AM Theodore Brown > wrote: > > > Hi internals, > > > > I discussed the syntax for attributes further with Benjamin, Martin, > > and several other internals developers off-list, and with their > > feedback completed an RFC proposing to use the shorter `@@` syntax > > instead of `<<>>` for attributes in PHP 8. > > > > https://wiki.php.net/rfc/shorter_attribute_syntax > > > > The goal is not to bikeshed over subjective syntax preferences, > > but to address several concrete shortcomings related to verbosity, > > nested attributes, confusion with generics and other tokens, and > > dissimilarity to other common languages. > > > > Larry's suggestion about #[Attr] makes an important argument about allowi= ng > to declare attributes in code in PHP 7 in a forward compatible way that h= as > not been brought up before. > > /** @ORM\Entity */ > #[ORM\Entity] > class User {} > > This code would work on PHP 7 and 8. > > The #[] syntax would have about equally low breaking potential as @@. It > would be the same syntax as Rusts, and close to C++/C# syntax. > I just noticed a power of Rusts outer attributes which this syntax count follow in a future. Following outer attributes in Rust's we could introduce in a future syntax like