Rather than having a single callback walk over the whole array (like array_map), I would like to know if there is a function to have an array of callbacks filter a value.
$value = 'foo';
$closures = array(
function($value) { return $value . 'bar'; }
function($value) { return $value . 'baz'; }
);
// Something other than a foreach with call_user_func?
// $value = array_callbacks($closures, $value);
// vs
foreach ($closures as $callback)
{
$value = call_user_func($callback, $value);
}
print $value; // foobarbaz