3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(array_map('trim', explode(',', 'Pizza, Salad, Burger'))); var_dump(array_map(trim(...), explode(',', 'Pizza, Salad, Burger')));
Output for 8.1.0 - 8.1.13
array(3) { [0]=> string(5) "Pizza" [1]=> string(5) "Salad" [2]=> string(6) "Burger" } array(3) { [0]=> string(5) "Pizza" [1]=> string(5) "Salad" [2]=> string(6) "Burger" }
Output for 8.0.1 - 8.0.26
Parse error: syntax error, unexpected token ")" in /in/9a8I0 on line 4
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Parse error: syntax error, unexpected ')' in /in/9a8I0 on line 4
Process exited with code 255.

preferences:
193.9 ms | 1399 KiB | 78 Q