3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sort($array){ asort($array); foreach($array as $v){ return echo $v."<br>"; } } $arr[]="5"; $arr[]="2"; $arr[]="1"; $arr[]="4"; $arr[]="7"; sort($arr); ?>
Output for 7.1.0 - 7.1.23, 7.2.0 - 7.2.11
Parse error: syntax error, unexpected 'echo' (T_ECHO), expecting ';' in /in/9DEdj on line 5
Process exited with code 255.
Output for 5.6.38
Parse error: syntax error, unexpected 'echo' (T_ECHO) in /in/9DEdj on line 5
Process exited with code 255.

preferences:
177.58 ms | 1394 KiB | 44 Q