Re: [PATCH] [RFC] Closures and lambda functions in PHP
| From: | Stanislav Malyshev | Date: | Sun, 29 Jun 2008 22:20:15 +0000 |
| Subject: | Re: [PATCH] [RFC] Closures and lambda functions in PHP | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-38681@lists.php.net to get a copy of this message | ||
Hi!
* Class::__invoke() to allow functors[1]. The class "Closure" in
your proposal should also implement that method to make
method_exists() and ext/reflection behave.
* Change the behaviour how method calls are resolved. Method calls
on invokable objects (closures or functors) should work.
And to close the circle, add __invoke to ReflectionFunctionAbstract and implement it in Reflectionfunctiom and ReflectionMethod (here we might have trouble with specifying object, so need to do some thinking on it - maybe we'll need another class or augment ReflectionMethod somehow?)
echo $view->escape("<script>alert(1)</script>");If we use this syntax, and $view->escape is not defined, should we call __call or __get? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com