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
Ummm... never mind!
Sorry for the noise!
-nathan
On Wed, Nov 24, 2010 at 11:00 AM, Nathan Nobbe quickshiftin@gmail.comwrote:
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
Ummm... never mind!
Sorry for the noise!
-nathan
On Wed, Nov 24, 2010 at 11:00 AM, Nathan Nobbe quickshiftin@gmail.comwrote:
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