Re: Suggestion Method Constant
| From: | Sara Golemon | Date: | Thu, 12 Oct 2017 21:32:29 +0000 |
| Subject: | Re: Suggestion Method Constant | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100887@lists.php.net to get a copy of this message | ||
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