3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /** * Creates an anonymous filter function accepting items > $min * * Returns a single filter out of a family of "greater than n" filters */ function criteria_greater_than($min) { return function($itemio) use ($min) { var_dump($itemio); return $itemio > $min; }; } $input = array(1, 2, 3, 4, 5, 6); // Use array_filter on a input with a selected filter function $output = criteria_greater_than(3); print_r($output); // items > 3
Output for 7.3.0rc3
Closure Object ( [static] => Array ( [min] => 3 ) [parameter] => Array ( [$itemio] => <required> ) )