Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93290 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13635 invoked from network); 12 May 2016 19:27:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 May 2016 19:27:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=kontakt@beberlei.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=kontakt@beberlei.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain beberlei.de from 74.125.82.41 cause and error) X-PHP-List-Original-Sender: kontakt@beberlei.de X-Host-Fingerprint: 74.125.82.41 mail-wm0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:35643] helo=mail-wm0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 73/95-28272-029D4375 for ; Thu, 12 May 2016 15:27:28 -0400 Received: by mail-wm0-f41.google.com with SMTP id e201so271126752wme.0 for ; Thu, 12 May 2016 12:27:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=+51u04Z5h+xkeS1uD6GAGvJjitH+bNvwW3OtKGx+CXc=; b=L4/DpV1Bfg9d9h1D0I2CbIfsWWEHAo3GzKSurVHMUdJSrncEIfToPTMUkKbFiocMWd fp8wkGgtWVOfvYGQ4ag8kINP5SlzmosHdWfj1TWaKMl0ljE/TAKepVU3XdVxrr1fZRtd lnZblZWY8tqZdJvM7YPTNOL+Dqcl3Jq5yGcn7HZpO4fpWa1+JrTHFiCy1ZbrYOheKqmV Q0igfoCNUaXuXzzzJtjqV9Q+f+KyqH35byQRQoroL6jwc9/K9q49KVpqGWyRqwnTp9Yw NezCzm+Z8C5pydgYJzbYCE5QtbGbSUwFrwj6KGY33/zEW+vsDiU+6dwa2gl+FLtupH2M tq6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=+51u04Z5h+xkeS1uD6GAGvJjitH+bNvwW3OtKGx+CXc=; b=P+DloKtdpHXe66Gg7HTgjLIJSiVzJOsi8JYSOPl6fGkhBZUl/68LIXzMpamrXCiH3n xAXf/A1MgGTrdJRGB/5fVBiyOVnaBud+iiAJdQ5UUIyx9LqWWe0u8LTxHOXkWiE3b1QW 5iVownXrXzUfIspEHle3DVx1kP26qeUJfD1xODorEK7iooVCaQ4+he54AyxwkHCtT/Lz cMrwk6LwRUypnWk6aRGMM5sI9O5M77FT06SnOj9yzHTM2XwaeZjHW3MelvK2cLt4ABMK PkpwLE5DYdpgRy54zRPykPVfO2o6TAh1OaD3DAavC/mw9j0fRx30FaQHXrfOEDzs8cQy k7Gg== X-Gm-Message-State: AOPr4FX02qvxm7SCFYOUGpoC9VU8I8gVmqiiAWzR4pF3mqcH6gdoGw/l1TODIZW2DUzmap39GdAhgiKmRCWz4A== MIME-Version: 1.0 X-Received: by 10.194.205.105 with SMTP id lf9mr11536702wjc.25.1463081245196; Thu, 12 May 2016 12:27:25 -0700 (PDT) Received: by 10.194.94.163 with HTTP; Thu, 12 May 2016 12:27:25 -0700 (PDT) X-Originating-IP: [77.11.104.106] In-Reply-To: References: Date: Thu, 12 May 2016 21:27:25 +0200 Message-ID: To: Rasmus Schultz Cc: Marco Pivetta , Dmitry Stogov , internals Content-Type: multipart/alternative; boundary=047d7b874c24e64f8e0532aa257c Subject: Re: [PHP-DEV] [RFC] [VOTE] PHP Attributes From: kontakt@beberlei.de (Benjamin Eberlei) --047d7b874c24e64f8e0532aa257c Content-Type: text/plain; charset=UTF-8 On Thu, May 12, 2016 at 9:02 PM, Rasmus Schultz wrote: > My problem with this PSR is you've created something that strongly > resembles function or constructor calls, but in reality is just > key/value pairs. > Its actually function calls, not constructors calls :-) > > That's confusing in itself, but also puts an unnecessary burden on > consumers who have to figure out how to map this apparently > "something" to "something real" - since it really isn't anything other > than pretty syntax for arrays associated with source-code elements. > > Did anybody look at my notes here? > > https://gist.github.com/mindplay-dk/ebd5e4f7da51da3c4e56232adef41b46 > > I think this is much simpler and far more flexible - it lets you do > what you're proposing with attributes (by annotating with simple > arrays) and also lets you create annotation classes. > > Would anyone care to comment? > What happens if you say <<$x>> and then call $reflection->getAttributes() in your eample? what is $x? That is the problem with immediately evaluating everything non "constant". There is no context. > > > On Thu, May 12, 2016 at 4:53 PM, Marco Pivetta wrote: > > On 12 May 2016 at 16:29, Benjamin Eberlei wrote: > > > >> On Tue, May 10, 2016 at 8:29 PM, Dmitry Stogov wrote: > >> > >> > Hi internals, > >> > > >> > > >> > I've started voting on "PHP Attributes" RFC. > >> > > >> > > >> > https://wiki.php.net/rfc/attributes > >> > > >> > > >> > In my opinion, "PHP Attributes" might be a smart tool for PHP > extension, > >> > but it's not going to be the end of the world, if we decided to live > with > >> > doc-comments only. > >> > > >> > > >> > Thanks. Dmitry. > >> > > >> > >> I voted -1 > >> > >> Reasons: from a Doctrine Annotations maintainer perspective, either > getting > >> a list (without keys) of strings back or ast\nodes are not enough or way > >> too advanced for our use-case. The middle ground is missing where a > >> (Name borrowed from the RFC) can be an arbitrarily deep > >> nested array, that means getAttributes() does should not only return > >> "string" or ast\node as result for each attribute, to there should be a > way > >> to get arrays back. > >> > >> Example: > >> > >> https://gist.github.com/beberlei/18db9f7d5f6157b817348a58fa2aee25 > >> > >> greetings > >> Benjamin > >> > > > > Urgh, that is indeed quirky, and makes it unusable. > > > > Is that an implementation or a spec issue? I know PHP 5.6+ allows array > > constants, but I am not aware of whether that is in the specification. > > > > Indeed, show-stopper here. I'll have to vote "-1" for now, and wait for a > > version that either explicitly contains any constant expression or just > > supports arrays as constants. > > > > I'll also need to compile the branch and try it out myself before voting > > further: my bad for being hasty. > > > > Marco Pivetta > > > > http://twitter.com/Ocramius > > > > http://ocramius.github.com/ > --047d7b874c24e64f8e0532aa257c--