3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = ['mo' => true, 'tue' => false]; var_dump(array_filter($a, function($k,$v) { return $v; }));
Output for 7.1.0 - 7.2.6
Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 1 passed and exactly 2 expected in /in/EFvim:5 Stack trace: #0 [internal function]: {closure}(true) #1 /in/EFvim(5): array_filter(Array, Object(Closure)) #2 {main} thrown in /in/EFvim on line 5
Process exited with code 255.
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.20
Warning: Missing argument 2 for {closure}() in /in/EFvim on line 5 Notice: Undefined variable: v in /in/EFvim on line 5 Warning: Missing argument 2 for {closure}() in /in/EFvim on line 5 Notice: Undefined variable: v in /in/EFvim on line 5 array(0) { }
Output for hhvm-3.15.4
Warning: __invoke() expects exactly 2 parameters, 1 given in /in/EFvim on line 5 Notice: Undefined variable: v in /in/EFvim on line 5 Warning: __invoke() expects exactly 2 parameters, 1 given in /in/EFvim on line 5 Notice: Undefined variable: v in /in/EFvim on line 5 array(0) { }