Re: Re: Revise callback Psuedo-type to support new Closure class ?

From: Date: Thu, 25 Nov 2010 14:24:25 +0000
Subject: Re: Re: Revise callback Psuedo-type to support new Closure class ?
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-50527@lists.php.net to get a copy of this message
On 24 November 2010 18:03, Nathan Nobbe <quickshiftin@gmail.com> wrote: > Ummm... never mind! > > Sorry for the noise! > > -nathan > > On Wed, Nov 24, 2010 at 11:00 AM, Nathan Nobbe <quickshiftin@gmail.com>wrote: > >> Hi all, >> >> I had a thought this morning and would like some feedback.  Don't you think >> it would make sense to allow the callback psuedo-type to also allow the new >> Closure class to be an acceptable data type?  A simple example that would be >> nice to have working would be >> >> <?php >> $fClosure = function($val, $key) { >>     echo "$key => $val" . PHP_EOL; >> } >> >> $aNumbers = array(5, 4, 3, 2, 1); >> >> array_walk($aNumbers, $fClosure); >> ?> >> >> Thoughts ? >> >> -nathan >> > I bet you thought you had something there... Ha! It is a pity that the error is tagged as being on line 6 and not line 4. I can see why. It isn't an error until the first non ; following the closing brace (excluding comments). So ... $fn = function() // comment ; is valid. Having the error on the same line as the closing brace would be nice though.. Richard. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

« previous php.internals (#50527) next »