Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110447 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 50718 invoked from network); 9 Jun 2020 13:34:05 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Jun 2020 13:34:05 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1EBE31804B7 for ; Tue, 9 Jun 2020 05:17:44 -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-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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, 9 Jun 2020 05:17:43 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id a9so21190606ljn.6 for ; Tue, 09 Jun 2020 05:17: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=MHs6YpAlCf8bdaeU0t7OTaCFH4ezzsvwdX7GUmUGcZM=; b=S3pR4xRnRLoi1un0yyOhSSjYcw+MTK5gqd3aPS2/7n3uHRZd/v+0XNeVYfwsHEjOcc dkwgobEGa3HLekBJy3ixtBNFd1yZfrgWxMM3BgvsxH/wYRwqR6YLzgWtlsYj9NbN+/XS ALB5MiGo1l+O45EYqF3k77fgSE8cbGs57402F1yVwv3oChriciDzBKL7O0ollKI7/zyr raTSjks+Nbz7Lbb0TwgKoGK8x6l6ZsyBiPZqINWE4U4LXLs63Oq1HRYR4+m5Ad6EaAo2 Ogp1DSj1pZ2E5JGMqVf7bddPojNAl94QTGV//Ytc96/flG70kMcWt1Y0NlPIor/Q7Kz7 0rHg== 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=MHs6YpAlCf8bdaeU0t7OTaCFH4ezzsvwdX7GUmUGcZM=; b=KDTHa7s6DtYbYxsN0ZDv/3eWrTqIUHbLV9+82SCvuIFGmqhZ5Z3Iox/UTH+1Keb4UZ K4qyTtFJ+CF6vuR6wgrAc+9ISnZl0zdPh7+YsAiTdYYuKoepkGhKoQuIQr7p7LALFhWY O7/BotnzHZlT8l/zLYbTPgZrX5QDwxWCiESNss67gyQtcJiACmpt1zEQw64D4vA7pidm 5R7iJYOi18SpVUj7Wb0e/XuXlkfaWEh0jffIOUBUYRNUlcsbNiio4AHSmyUt3UhhPMa2 hC3OsqiKD8FcBL3dPhphB8cQKv1X43o6KP1l9IfmN10Ni2gBxaZNACzFRq3g7FkcPR1u Yxkg== X-Gm-Message-State: AOAM530m9N5vxZpvOnG0iO53Wa6fIT8eAD+Zn+eIi3FBnLYLK9+vl8Xu W1p/uxrVf/MJvff6w6mHzTIVsK4YchP1MWxco7M= X-Google-Smtp-Source: ABdhPJxanoiUokZslghmNepSBRhXa1DOijTU3Z5dc9OHfhe0Uw/RQsdWBKPlWpdiAaz75U6zEsczP1CFWZs4Tuo8FUY= X-Received: by 2002:a2e:92d5:: with SMTP id k21mr13135736ljh.445.1591705061320; Tue, 09 Jun 2020 05:17:41 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 9 Jun 2020 15:17:29 +0300 Message-ID: To: Benjamin Eberlei Cc: Theodore Brown , Sara Golemon , carusogabriel34@gmail.com, internals Content-Type: multipart/alternative; boundary="000000000000c4714f05a7a5b680" Subject: Re: [PHP-DEV] [RFC] Shorter attribute syntax From: benas.molis.iml@gmail.com (Benas IML) --000000000000c4714f05a7a5b680 Content-Type: text/plain; charset="UTF-8" +1 On Tue, Jun 9, 2020, 2:56 PM Benjamin Eberlei wrote: > 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 allowing > to declare attributes in code in PHP 7 in a forward compatible way that has > 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. > > As such, instead of going through each alternative syntax one by one, with > with each having a 2/3 requirement to overthrow the old one, > I would be open to restart the secondary vote on Attributes syntax with > <<>> (status quo), @@ and #[] using the same ranked voting algorithm that > was used for the PHP 8 RM vote. > > @Sara @Gabriel I suppose this is something you two should be ok with (and > Theodore of course). > > I would take on the work to write about the third syntax alternative then. > The VoteRFC could just link to the three individual RFCs where each > discusses their syntax. > > > > > > Best regards, > > Theodore > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > --000000000000c4714f05a7a5b680--