3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $files1 = array('AAA', 'BBB', 'CcC'); function bbq( &$path ) { $path = strtolower($path); return true; } $files2 = array_filter($files1, '\\bbq'); var_dump($files1, $files2);
based on dp6Lt
Output for 7.0.0 - 7.2.0
array(3) { [0]=> string(3) "AAA" [1]=> string(3) "BBB" [2]=> string(3) "CcC" } array(3) { [0]=> string(3) "AAA" [1]=> string(3) "BBB" [2]=> string(3) "CcC" }
Output for 5.3.0 - 5.6.28
array(3) { [0]=> string(3) "aaa" [1]=> string(3) "bbb" [2]=> string(3) "ccc" } array(3) { [0]=> string(3) "aaa" [1]=> string(3) "bbb" [2]=> string(3) "ccc" }
Output for 4.3.2 - 5.2.17
Warning: array_filter(): The second argument, '\bbq', should be a valid callback in /in/RLlsR on line 10 array(3) { [0]=> string(3) "AAA" [1]=> string(3) "BBB" [2]=> string(3) "CcC" } NULL
Output for 4.3.0 - 4.3.1
Warning: array_filter() [http://www.php.net/function.array-filter]: The second argument, '\bbq', should be a valid callback in /in/RLlsR on line 10 array(3) { [0]=> string(3) "AAA" [1]=> string(3) "BBB" [2]=> string(3) "CcC" } NULL