3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $entry = array( 0 => 'foo', 1 => false, 2 => -1, 3 => null, 4 => '' ); var_dump(array_filter($entry)); var_dump(array_filter($entry, 'isset'));
based on Cm8g3
Output for 5.3.0 - 7.2.0
array(2) { [0]=> string(3) "foo" [2]=> int(-1) } Warning: array_filter() expects parameter 2 to be a valid callback, function 'isset' not found or invalid function name in /in/cDdjV on line 12 NULL
Output for 4.3.2 - 5.2.17
array(2) { [0]=> string(3) "foo" [2]=> int(-1) } Warning: array_filter(): The second argument, 'isset', should be a valid callback in /in/cDdjV on line 12 NULL
Output for 4.3.0 - 4.3.1
array(2) { [0]=> string(3) "foo" [2]=> int(-1) } Warning: array_filter() [http://www.php.net/function.array-filter]: The second argument, 'isset', should be a valid callback in /in/cDdjV on line 12 NULL