Re: Add \Countable support to \Closure

From: Date: Mon, 08 Aug 2011 11:16:18 +0000
Subject: Re: Add \Countable support to \Closure
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-54462@lists.php.net to get a copy of this message
On Mon, Aug 8, 2011 at 12:06 PM, Alexey Shein <confik@gmail.com> wrote: > 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. I am agreeing with the fact that we don't need any more magic in PHP and explicit methods go much further than any magic you can add to a language. > > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.internals (#54462) next »