I can't figure out what's wrong here. Here's my test.php file:
<?php
error_reporting(E_ALL);
echo phpversion();
$arr = array ();
$attrs = array_filter((array)$arr, function($v) {
return ($v || $v === 0 || $v === '0');
});
The output of this script is:
5.3.3 Warning: array_filter() expects parameter 2 to be a valid callback, no array or string given in /path/test.php on line 8
How can that be? I thought PHP 5.3 supported lambdas.