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($itemuuu) use ($min) { var_dump($itemuuu); return $item > $min; }; } $input = array(1, 2, 3, 4, 5, 6); // Use array_filter on a input with a selected filter function $output = array_filter($input, criteria_greater_than(3)); print_r($output); // items > 3
Output for 7.3.0rc3
int(1) Notice: Undefined variable: item in /in/e2lQV on line 11 int(2) Notice: Undefined variable: item in /in/e2lQV on line 11 int(3) Notice: Undefined variable: item in /in/e2lQV on line 11 int(4) Notice: Undefined variable: item in /in/e2lQV on line 11 int(5) Notice: Undefined variable: item in /in/e2lQV on line 11 int(6) Notice: Undefined variable: item in /in/e2lQV on line 11 Array ( )