3v4l.org

run code in 300+ PHP versions simultaneously
<?php $logfile = $argv[1]; function doLog($msg) { global $logfile; $datestr = date("Y-M-d H:i:s T",time()); $msg="[".$datestr."]". $msg . "\n"; file_put_contents($logfile, $msg, FILE_APPEND); } doLog("Starting test"); $i = 0; while(true) { echo "Echoing a string to standard out!!!\n"; if((++$i % 10) == 0) { doLog("Completed $i iterations"); } } doLog("Script exited normally"); return 0; ?>

preferences:
26.55 ms | 402 KiB | 5 Q