On Mon, Mar 9, 2020 at 8:29 PM Robert Hickman <robehick...@gmail.com> wrote:

> > > 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.
> > >
>
> Why do decorator names refer to classes, rather than any callable as in
> python?
>

Decorators in Python work differently (to my understanding) that the
following function declartion

@foo
def bar():

At runtime becomes foo(bar());

PHPs Attributes do not become runtime behavior, instead they allow the
Reflection API to access the attributes as metadata.

As such declaring a callable doesn't make sense, because an attribute is
not a callable, it is (meta-)data.

Reply via email to