Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110445 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 46203 invoked from network); 9 Jun 2020 13:12:10 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Jun 2020 13:12:10 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4F52A1804B7 for ; Tue, 9 Jun 2020 04:55:48 -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.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.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 04:55:47 -0700 (PDT) Received: by mail-wr1-f65.google.com with SMTP id x13so20979032wrv.4 for ; Tue, 09 Jun 2020 04:55:47 -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=pgFXNgMaumz3lGZHqZiLiIZVsRLHXSFWmB6YZyv5SMo=; b=ht9fJ8Cgtj3mCpnmahiQw8WGXMIGBHyNvefcrw2t6FCBOI9VXTFb8oJJRgKrl4j5ud lmJdgi6R0c8qA0EJTmoV2Rt48haCAB2nPEBqfGlyKAVBiX8E4M8L8gm14k7x30H7aVrb R45ApibEzZUJeqQBoruuJZVTR79BHdsYcxqN6w+4u4AyTNzoGyFKrh5XqOCx0C0sf7Wc kAKT6eYKq6uNBOVVYEHerBlkEYDzgKN+bnjqWxvdKee/xlzgybUJxx/4ZycSfXIRZmsG 6BedQtoLmVRnzb/w+eOWfPpbCN286UY9Irs7FP00gD8/u0wEVLcYkEsoT2JgC8qUeieW nDPQ== 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=pgFXNgMaumz3lGZHqZiLiIZVsRLHXSFWmB6YZyv5SMo=; b=TMsEhAYnXxCidJ+93dhoOolF1UzTB9o3zXA1rFHtEVJ6ntawKydfZRw1z3mQOnksWf qJWa1n5FvWBxQF+jIUa2RBnm7mHeuISldTObSO6pfYe/Q/ctMa7JMYiAAgpvmvrBzeWf uojvpWHjDQ4fBwRAU96cnTu9fFq94YYF5Hb+5umKpDjo9yySPz1HcGGBDC2NM0tBSL2f wWtNcMNoPVcIPTMTAxV5LDsNtragvLemXeWIjB1KxuIqFos902QM0I0DyjDPgshSSJzE HoJJyuk2isPKeqWfnwJaty9yd4UDoYppp4HE/5+1grI+3MH8KcsttN30fFOz8tPRHIeR pS5g== X-Gm-Message-State: AOAM533jhAaSj80rfhUtiUTMRxLPBZcUrX4dn6WbVfTBQcHSR47yBafd d3b76k1ylCxeKJRZ4V6GkgwGLzWZD3gercFIWbVoJw== X-Google-Smtp-Source: ABdhPJxT3aT1ea0WikC6fW2EqlfpU09GN/A1YT6XcGHOB66tinpuzcgHV/06ribc39y9tSfG/FmiZ4kBfXfNW5xogFQ= X-Received: by 2002:adf:e588:: with SMTP id l8mr4250556wrm.255.1591703745846; Tue, 09 Jun 2020 04:55:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 9 Jun 2020 13:55:34 +0200 Message-ID: To: Theodore Brown , Sara Golemon , carusogabriel34@gmail.com Cc: internals Content-Type: multipart/alternative; boundary="0000000000005c235405a7a56820" Subject: Re: [PHP-DEV] [RFC] Shorter attribute syntax From: kontakt@beberlei.de (Benjamin Eberlei) --0000000000005c235405a7a56820 Content-Type: text/plain; charset="UTF-8" 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 > > --0000000000005c235405a7a56820--