3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(1, "apples",2, "oranges",3, "plums"); $callback = function($item) { return strtoupper($item); }; $nu = array_map( "strtoupper", $filtered); var_dump($nu); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Warning: Undefined variable $filtered in /in/S93jJ on line 9 Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, null given in /in/S93jJ:9 Stack trace: #0 /in/S93jJ(9): array_map('strtoupper', NULL) #1 {main} thrown in /in/S93jJ on line 9
Process exited with code 255.
Output for 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: filtered in /in/S93jJ on line 9 Warning: array_map(): Expected parameter 2 to be an array, null given in /in/S93jJ on line 9 NULL
Output for 7.3.32 - 7.3.33
Warning: array_map(): Expected parameter 2 to be an array, null given in /in/S93jJ on line 9 NULL
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33
Notice: Undefined variable: filtered in /in/S93jJ on line 9 Warning: array_map(): Argument #2 should be an array in /in/S93jJ on line 9 NULL

preferences:
151.49 ms | 402 KiB | 200 Q