3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = range(0,10); $arr2 = array('key1'=>'value1','key2'=>'value2','key3'=>'value3'); $test1 = array_filter($arr1,'odd'); echo implode('',$arr1)."\t"; echo implode('',$arr2)."\t"; echo $test1."\t";
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught TypeError: array_filter(): Argument #2 ($callback) must be a valid callback or null, function "odd" not found or invalid function name in /in/sJPbX:6 Stack trace: #0 /in/sJPbX(6): array_filter(Array, 'odd') #1 {main} thrown in /in/sJPbX on line 6
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Fatal error: Uncaught TypeError: array_filter(): Argument #2 ($callback) must be a valid callback, function "odd" not found or invalid function name in /in/sJPbX:6 Stack trace: #0 /in/sJPbX(6): array_filter(Array, 'odd') #1 {main} thrown in /in/sJPbX on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33
Warning: array_filter() expects parameter 2 to be a valid callback, function 'odd' not found or invalid function name in /in/sJPbX on line 6 012345678910 value1value2value3
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Warning: array_filter(): The second argument, 'odd', should be a valid callback in /in/sJPbX on line 6 012345678910 value1value2value3
Output for 4.3.0 - 4.3.1
Warning: array_filter() [http://www.php.net/function.array-filter]: The second argument, 'odd', should be a valid callback in /in/sJPbX on line 6 012345678910 value1value2value3

preferences:
210.9 ms | 401 KiB | 311 Q