> On Feb 13, 2020, at 7:24 PM, Rowan Tommins <rowan.coll...@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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php