Re: Suggestion Method Constant
| From: | Mathias Grimm | Date: | Fri, 13 Oct 2017 06:41:59 +0000 |
| Subject: | Re: Suggestion Method Constant | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100888@lists.php.net to get a copy of this message | ||
I also thought about the same for functions, just to be even more
consistent.
my_func::function
On 12 Oct 2017 23:32, "Sara Golemon" <pollita@php.net> wrote:
> On Thu, Oct 12, 2017 at 2:33 PM, Michael Döhler <michaeldoehler@me.com>
> wrote:
> > I am open for any approach, but maybe we have to differentiate between
> class constants and method references?
> >
> Given the discussion we had around the namespace separator (and why we
> DIDN'T go with ::), there may be similar issues here. Maybe not,
> given the final component is specifically T_METHOD, but it should be
> prototyped to be sure.
>
> As to what such a reference would evaluate to: Foo::bar::method -> [
> Foo::class, 'bar' ] as Michael Döhler suggests seems the obvious
> answer, but (Foo::class.'::bar') may be what some would expect.
> Ideally we'd have first-class references to functions.
>
> -Sara
>