Re: Add \Countable support to \Closure
| From: | Ivan Enderlin @ Hoa | Date: | Mon, 08 Aug 2011 08:26:30 +0000 |
| Subject: | Re: Add \Countable support to \Closure | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-54457@lists.php.net to get a copy of this message | ||
On 08/08/11 09:45, Johannes Schlüter wrote:
On Mon, 2011-08-08 at 09:16 +0200, Ivan Enderlin @ Hoa wrote:-- Ivan Enderlin Developer of Hoa http://hoa.42/ or http://hoa-project.net/ Member of HTML and WebApps Working Group of W3C http://w3.org/Hi Internals, I would like to suggest you a new feature (for PHP5.4 or maybe next). The idea is to implement the \Countable interface into closures to easily count the arguments number.NO! One could add a getParmNo() or such if really needed while I think reflection is better (as it also gives parameter information about required/optional and type "hints") Countable implies ArrayAccess or such. If it is the semantics you ascribe to \Countable, then ok, there is no problem :-).