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 & 4); } $petr_fil=array_filter($petr, bazar); print_r($petr); print_r($petr_fil); print_r(bazar(6));
based on d5vpU
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/UgP57 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 ( [2] => 4 [3] => 5 [4] => 6 [6] => 4 [7] => 7 [8] => 5 [9] => 6 ) 4
Output for 5.3.19 - 7.1.10
Notice: Use of undefined constant bazar - assumed 'bazar' in /in/UgP57 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 ( [2] => 4 [3] => 5 [4] => 6 [6] => 4 [7] => 7 [8] => 5 [9] => 6 ) 4