array_filter($my_data, function($test){ return 3 === ($test % 4) });
What's wrong with regular functions?
At risk of wading into yet circular another discussion on internals@,
I was part of the original thread on this subject, and I agree with
Stas here: unless they're real closure, they're pretty useless.
Apart from saving a few keystrokes, the above could easily be changed
to the following, which is much more clear, DOES compile at compile-
time, and works without adding a new construct that looks like a
closure, but is not indeed one:
function aiusdyasdjkhasdIMASHEDTHEKEYBOARD($test){ return 3 === ($test
% 4) }
array_filter($my_data, 'aiusdyasdjkhasdIMASHEDTHEKEYBOARD');
// I copy & pasted the callback name; aren't modern computers
fascinating?! (-:
S
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php