Re: Add \Countable support to \Closure
| From: | Alexey Shein | Date: | Mon, 08 Aug 2011 11:06:53 +0000 |
| Subject: | Re: Add \Countable support to \Closure | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-54461@lists.php.net to get a copy of this message | ||
I think it's just a bad habit inherited from Javascript, where you can
do like this:
var a = function(a, b) { };
alert(a.length); // shows 2
I don't think that PHP needs it, explicit method is way better.
2011/8/8 Sebastian Bergmann <sebastian@php.net>:
> On 08/08/2011 04:49 AM, Etienne Kneuss wrote:
>>
>> I don't believe Countable implies ArrayAccess, but I do think that
>> Countable should only be implemented in cases where it is obvious what
>> it will return, for example collections.
>>
>> In this case, count(Closure) is really not that explicit, I'd rather
>> have an explicit method.
>
> ACK
>
> --
> Sebastian Bergmann Co-Founder and Principal Consultant
> http://sebastian-bergmann.de/
> http://thePHP.cc/
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Regards,
Shein Alexey