3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $petr=array(1,2,4,5,6,8,4,7,5,6,3); function bazar($cyfr){ return ($cyfr & 2); } $petr_fil=array_filter($petr, bazar); print_r($petr); print_r($petr_fil);
based on d4aHV
Output for 7.2.0
Warning: Use of undefined constant bazar - assumed 'bazar' (this will throw an Error in a future version of PHP) in /in/EmsSU on line 9 Array ( [0] => 1 [1] => 2 [2] => 4 [3] => 5 [4] => 6 [5] => 8 [6] => 4 [7] => 7 [8] => 5 [9] => 6 [10] => 3 ) Array ( [1] => 2 [4] => 6 [7] => 7 [9] => 6 [10] => 3 )
Output for 5.3.19 - 7.1.10
Notice: Use of undefined constant bazar - assumed 'bazar' in /in/EmsSU on line 9 Array ( [0] => 1 [1] => 2 [2] => 4 [3] => 5 [4] => 6 [5] => 8 [6] => 4 [7] => 7 [8] => 5 [9] => 6 [10] => 3 ) Array ( [1] => 2 [4] => 6 [7] => 7 [9] => 6 [10] => 3 )