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, 'is_scalar'));
based on cDdjV
Output for 4.3.0 - 7.2.0
array(2) { [0]=> string(3) "foo" [2]=> int(-1) } array(4) { [0]=> string(3) "foo" [1]=> bool(false) [2]=> int(-1) [4]=> string(0) "" }