3v4l.org

run code in 300+ PHP versions simultaneously
<?php function perg($dari, $ke, $callback) { echo "Saya pergi dari {$dari} menuju ke {$ke}."; if(is_callable($callback)){ $callback(); } } pergi('Jakarta','Bandung', function(){ echo 'Saya mau pulang kampung dulu'; }
Output for 5.4.0 - 5.4.15
Parse error: syntax error, unexpected end of file in JKQip on line 12
Process exited with code 255.
Output for 5.3.25
Parse error: syntax error, unexpected $end in /in/95tkh on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected $end in JKQip on line 12
Process exited with code 255.

preferences:
178.82 ms | 1395 KiB | 49 Q