Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109707 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85387 invoked from network); 19 Apr 2020 22:59:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Apr 2020 22:59:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 22C041801FD for ; Sun, 19 Apr 2020 14:30:28 -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,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS6724 85.215.255.0/24 X-Spam-Virus: No X-Envelope-From: Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.20]) (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 ; Sun, 19 Apr 2020 14:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1587331824; s=strato-dkim-0002; d=kelunik.com; h=Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=/N+41E+C4KtuXtOuftByEWKzpRKkGR4HrAVG6nvepGM=; b=mwKymnkZt5LGZbzkcXaV5boxYe3AxjUFRPSTxPQPSyL0VfD+37t46HGvWymakvnPN8 Xjq+i+nPfJ66tb5HtmhJ1FIiplSQhUh6nCRaRTMm90RrWjk3nU7JZH/hJS+vvDA+0A2E 2AECxA5cFNrRh14rAy/BxT5xUhvqgVuDd+3cUV3n/L3lt2X9T5hap3GY1cz5YZrMiFPD G06+FLVdlStPvQbWFtmk060dfcpeMbkD5vKATKLnm52JLmiWMwPp8QTOpg0X5N53P+qD UCnQJBlu8R7WCyN4JzOjYqSCS6C+ExU987Y9OOiaFfngI3Efci1rRs4rPioapoZacYJk 3Mjg== X-RZG-AUTH: ":IWkkfkWkbvHsXQGmRYmUo9mlsGbEv0XHBzMIJSS+jKTzde5mDb8Aa6l6w/5N" X-RZG-CLASS-ID: mo00 Received: from mail-ua1-f51.google.com by smtp.strato.de (RZmta 46.5.0 AUTH) with ESMTPSA id 605d46w3JLUO9yZ (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Sun, 19 Apr 2020 23:30:24 +0200 (CEST) Received: by mail-ua1-f51.google.com with SMTP id g10so2883487uae.5 for ; Sun, 19 Apr 2020 14:30:24 -0700 (PDT) X-Gm-Message-State: AGi0PuaKeUYrd5kMQZ9HqrcPpvQRXH2uFQlNEjznHMy6rps2G1//QQjp hPycTKrpTviMMQoVRouCx1kmW3YB+F6Sk/ZhY4Y= X-Google-Smtp-Source: APiQypIa3nyjVpw52t/u8ps9tOjmRVG+r/a6HscCer4tkkauGzMMeZYKRQf1USkPFbdAWzHMi4XniR3/n0v1055za8A= X-Received: by 2002:ab0:6148:: with SMTP id w8mr5865067uan.30.1587331823337; Sun, 19 Apr 2020 14:30:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 19 Apr 2020 23:30:11 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Benjamin Eberlei Cc: PHP Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Re: [RFC] Attributes v2 From: me@kelunik.com (Niklas Keller) Hey Benjamin, I haven't really followed the discussion, so sorry if anything I'm writing has already been discussed. Attributes / annotations are one of the two things I currently miss most in PHP (the other being generics), so thanks for the work on that! There are a few points that seem odd to me, I'll start with the "Php" prefix: ```php > class SingleArgument { public $value; public function __construct(string $value) { $this->value = $value; } } ``` I think this should be <> instead, if we go with that syntax. However, I'd even propose another syntax, as attributes aren't ordinary classes, I'm not sure whether they should be instantiatable from userland and / or be able to use inheritance, especially as constructors in PHP aren't subject to variance rules. I guess the INSTANCE_OF filter also changes whether the attributes are autoloaded or not? I expect annotations to be readonly, which classes as outlined in the RFC cannot currently enforce in PHP. A syntax similar to interfaces might be appropriate, I'm not sure whether that has been discussed: ```php : > > As there has only been minimal new discussion after the last changes to the > RFC I wanted to give a heads up that I will open the vote on Monday > afternoon. > > If you have further remarks or questions about the RFC, please let me know. > > On Mon, Mar 9, 2020 at 3:42 PM Benjamin Eberlei wrote: > > > Hi all, > > > > I want to resurrect Dmitrys Attributes RFC that was rejected for 7.1 in > > 2016 with a few changes, incorporating feedback from the mailing list back > > then and from talking to previous no voters. > > > > The RFC is at https://wiki.php.net/rfc/attributes_v2 > > > > A working patch is at https://github.com/beberlei/php-src/pull/2 though > > work around the details is still necessary. > > > > The RFC contains a section with common criticism and objections to > > attributes, and I hope to have collected and responded to a good amount > > already from previous discussions. > > > > There is also a fair amount of implementation detail still up for debate, > > which is noted in "Open Issues". I have pre-committed to one approach, but > > listed alternatives there. On these issues I am looking for your feedback. > > > > greetings > > Benjamin > >