Hi Dan,

Dan Ackroyd wrote:
I'd like to start a discussion of a proposal to allow closures to be
created in user-land without having to use a whole lot of reflection
code.

https://wiki.php.net/rfc/closurefromcallable

Thanks to Joe and Bob for the assistance in the patch.

I've wanted something like this for a long time. All that being said, though, I'm not sure a function is the way to do it. In C I can just use the name of a function to get a function pointer, couldn't we do this in PHP somehow? That is, `array_map(strlen, ["foo", "foobar", "elePHPant"]);` rather than `array_map(closure('strlen'), ...)`.

I realise this would be a bit difficult to do, but I think it's a nicer approach.

Thanks.

--
Andrea Faulds
http://ajf.me/

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

Reply via email to