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; }, ARRAY_USE_BOTH));
based on EFvim
Output for 7.3.0
Warning: Use of undefined constant ARRAY_USE_BOTH - assumed 'ARRAY_USE_BOTH' (this will throw an Error in a future version of PHP) in /in/pEcGM on line 5 Warning: array_filter() expects parameter 3 to be int, string given in /in/pEcGM on line 5 NULL
Output for 7.2.0 - 7.2.13
Warning: Use of undefined constant ARRAY_USE_BOTH - assumed 'ARRAY_USE_BOTH' (this will throw an Error in a future version of PHP) in /in/pEcGM on line 5 Warning: array_filter() expects parameter 3 to be integer, string given in /in/pEcGM on line 5 NULL
Output for 7.0.0 - 7.1.25
Notice: Use of undefined constant ARRAY_USE_BOTH - assumed 'ARRAY_USE_BOTH' in /in/pEcGM on line 5 Warning: array_filter() expects parameter 3 to be integer, string given in /in/pEcGM on line 5 NULL
Output for hhvm-3.15.4
Notice: Use of undefined constant ARRAY_USE_BOTH - assumed 'ARRAY_USE_BOTH' in /in/pEcGM on line 5 Warning: __invoke() expects exactly 2 parameters, 1 given in /in/pEcGM on line 5 Notice: Undefined variable: v in /in/pEcGM on line 5 Warning: __invoke() expects exactly 2 parameters, 1 given in /in/pEcGM on line 5 Notice: Undefined variable: v in /in/pEcGM on line 5 array(0) { }
Output for 5.6.0 - 5.6.38
Notice: Use of undefined constant ARRAY_USE_BOTH - assumed 'ARRAY_USE_BOTH' in /in/pEcGM on line 5 Warning: array_filter() expects parameter 3 to be long, string given in /in/pEcGM on line 5 NULL