3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array( 1,1,1,1,2,1,1,1,1,2,1,1,1,1,2 ); global $b; $b = 2; function c( $d ){ global $b; return $d==$b; } var_dump( array_filter( $a, 'c' ) );
Output for 4.3.0 - 7.1.0
array(3) { [4]=> int(2) [9]=> int(2) [14]=> int(2) }