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 62GBV
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/FYnLk:8 Stack trace: #0 [internal function]: {closure}('value') #1 /in/FYnLk(8): array_filter(Array, Object(Closure)) #2 {main} thrown in /in/FYnLk on line 8
Process exited with code 255.
Output for 5.6.30, 7.0.30
Warning: Missing argument 2 for {closure}() in /in/FYnLk on line 8 Notice: Undefined variable: value in /in/FYnLk on line 8 Array ( )
Output for hhvm-3.22.0
Warning: __invoke() expects exactly 2 parameters, 1 given in /in/FYnLk on line -1 Notice: Undefined variable: value in /in/FYnLk on line -1 Array ( )
Output for hhvm-3.18.5 - 3.21.3
Warning: __invoke() expects exactly 2 parameters, 1 given in /in/FYnLk on line 8 Notice: Undefined variable: value in /in/FYnLk on line 8 Array ( )