On 29.09.2015 16:23, Dan Ackroyd wrote:
Hello internals,
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.
Your first example on the page is a little weird to me. You claim that
one currently needs to have the callback method public, although you can
easily work around that. Instead of doing this, as in your example:
return [$this, 'genericValidation']
you could just do this:
return function ($data) { return $this->genericValidation($data); }
and keep the actual callback method private/protected.
--
Ben Scholzen 'DASPRiD'
Community Review Team Member | m...@dasprids.de
Zend Framework | http://www.dasprids.de
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php