FAQ

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
<php-constant> (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/

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 24 of 28 | next ›
Discussion Overview
groupphp-internals @
categoriesphp
postedMay 10, '16 at 6:29p
activeMay 16, '16 at 1:49a
posts28
users10
websitephp.net

People

Translate

site design / logo © 2019 Grokbase