Re: [RFC] [DISCUSSION]: Closure from callable
| From: | Ben Scholzen 'DASPRiD' | Date: | Sun, 04 Oct 2015 10:16:50 +0000 |
| Subject: | Re: [RFC] [DISCUSSION]: Closure from callable | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88658@lists.php.net to get a copy of this message | ||
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 | mail@dasprids.de Zend Framework | http://www.dasprids.de