Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110446 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 48539 invoked from network); 9 Jun 2020 13:23:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Jun 2020 13:23:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 562581804C8 for ; Tue, 9 Jun 2020 05:07:32 -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-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) (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:07:28 -0700 (PDT) Received: by mail-io1-f65.google.com with SMTP id m81so22442721ioa.1 for ; Tue, 09 Jun 2020 05:07:28 -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=nw0cXoew3rEPFZCjXezwOHQ4zwIRlp8+BQGRZkbngj0=; b=s4NKAQ0eTcs3KTaWsnuO8kUcKQ2gp93TgDD6LrzKf/B+YLlqRcY7J+NpAtmrLuuzmy C8FrOsvB4HIUwqZfXIrD1+t2cGyD9vrnjmo6vaKavor7GdPqIoUQiYMZh0ZIc4NmYPGt wXWKxl00aHSV/XvGmaKoFF9zs2iRgdgvcve6xk6sPTutzNajYj/J0KwCXyPuAmhwEUOH QfRb5ohAXQPArjCPbzEoXYCLkrBoIDNMIB1uliDdEXxlo3c4knMURtQEDYu8ZNa98jIO J7xX+HKOVX8mvrfAmR2yjNb7dUDYzvd5WEHqcVk1jf43cYw8EW6CuapvuvygIVVjxDB2 mkJA== 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=nw0cXoew3rEPFZCjXezwOHQ4zwIRlp8+BQGRZkbngj0=; b=j7TsRmGWLOvhJvE7p3dv8y7Qeu2YhQgE0Vtj9ZkLCd6HmYvsWNnFoF0UmNWtrChDfH 6A57StLDEFAqmHIN7mzdecnqTdf8H1Epn8Y3c+0weMISg77TmYoAgDSiAY+RS1aBtjZI S9+SME3P8tZdEVs2+vOzdL486okBUEmnwYpGgadRYpMlosNhVGsIj7Bk0fwVZwkdvetQ Pgbp6wKMAWRnyzBEOCNlvD8b7Jcqt0bqMvMzlTz+Ya98qQMpfw2VNMQy78lpG/ysOodo a2Ltuu9lDpfMhLw+uqXKU8HBvdMCUZabvoqbxhZdGaOSldh8ehAq59bVCjgZfTa/gMqi 0sgQ== X-Gm-Message-State: AOAM532UMX9K7TXwKDF+spa0rq1qIskADAwM35h1bhI1k9w0kG3Be4Zx MIzS4RnPUhjCVmwg80uXVJXCT3Bd+J1gwH0X/fM= X-Google-Smtp-Source: ABdhPJzHCjvgV/PwSVP1ptptUMxJNfbekpETWtUb+yc/ehtMK9p8FQHPe8kA4vo77e4JKkpCOOcbiLVkoQtNY5bj1x8= X-Received: by 2002:a5e:950f:: with SMTP id r15mr25630345ioj.87.1591704447497; Tue, 09 Jun 2020 05:07:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 9 Jun 2020 14:07:00 +0200 Message-ID: To: Benjamin Eberlei Cc: Theodore Brown , Sara Golemon , carusogabriel34@gmail.com, internals Content-Type: multipart/alternative; boundary="0000000000002e3bbd05a7a59211" Subject: Re: [PHP-DEV] [RFC] Shorter attribute syntax From: kjarli@gmail.com (Lynn) --0000000000002e3bbd05a7a59211 Content-Type: text/plain; charset="UTF-8" On Tue, Jun 9, 2020 at 1:55 PM Benjamin Eberlei wrote: > 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. > Hi, The idea of making annotations forward compatible in php7 this way has a big + from me. I honestly don't mind the syntax too much. How would multiline notations work with this? #[ORM\Entity( arg1, arg2 )] This notation would obviously break in php7. Would it be possible (in this case) to do something like the following example? This would have php7 not care because they are comments, while php8 could filter the # out and make it a valid annotation. #[ORM\Entity( # arg1, # arg2 #)] I'm also okay with having everything on a single line, just wanted to point out this might cause issues. Regards, Lynn --0000000000002e3bbd05a7a59211--