3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = array('key' => 'value'); print_r(array_filter($test, function($key, $value){ return $value == 'value';}) );
based on Y843a
Output for 7.1.0 - 7.3.0beta1
Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 1 passed and exactly 2 expected in /in/YaDWW:5 Stack trace: #0 [internal function]: {closure}('value') #1 /in/YaDWW(5): array_filter(Array, Object(Closure)) #2 {main} thrown in /in/YaDWW on line 5
Process exited with code 255.
Output for 5.6.30, 7.0.30
Warning: Missing argument 2 for {closure}() in /in/YaDWW on line 5 Notice: Undefined variable: value in /in/YaDWW on line 5 Array ( )
Output for hhvm-3.22.0
Warning: __invoke() expects exactly 2 parameters, 1 given in /in/YaDWW on line -1 Notice: Undefined variable: value in /in/YaDWW on line -1 Array ( )
Output for hhvm-3.18.5 - 3.21.3
Warning: __invoke() expects exactly 2 parameters, 1 given in /in/YaDWW on line 5 Notice: Undefined variable: value in /in/YaDWW on line 5 Array ( )