Re: [RFC]
| From: | Mike Schinkel | Date: | Fri, 14 Feb 2020 00:39:15 +0000 |
| Subject: | Re: [RFC] | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108558@lists.php.net to get a copy of this message | ||
> On Feb 13, 2020, at 7:24 PM, Rowan Tommins <rowan.collins@gmail.com> wrote:
>
> An idea I had earlier which might solve some of them is if what was returned was not a normal
> Closure instance, but a new class like FunctionReference. It could then "remember" the
> name of the function wrapped, and implement __toString, Serializable, etc. It could inherit from
> Closure, so instanceof checks would work, and bindTo would return a normal Closure. I'm sure
> there's downsides I haven't thought of yet, but I thought I'd throw the idea into the
> mix.
I thought about that too, and mentioned it yesterday in a reply[1] to you on this list.
Here is the link to the Gist with the hypothetical code using such a concept:
- https://gist.github.com/mikeschinkel/78684d708358e1d101e319c7a2fdef9c
-Mike
[1] https://www.mail-archive.com/internals@lists.php.net/msg100719.html