On 13 February 2020 18:19:08 GMT+00:00, Mike Schinkel <m...@newclarity.net> 
wrote:
>Eloquently maybe, but of limited vision.


I think that's a rather negative way of putting it; there was a request for use 
cases, and you have supplied some, so thank you. :)

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.

A possible future direction would then be to have ::class return some kind of 
ClassRef object, with the obvious downside that it would no longer pass string 
type hints without casting. I'm also not sure what the object would do, other 
than feel nicer from a type system point of view.

Regards,

-- 
Rowan Tommins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to