3v4l.org

run code in 300+ PHP versions simultaneously
<?php include('/tmp/test.txt'); $myfile = fopen("/tmp/test.txt", "w") or die("Unable to open file!"); $txt = "John Doe\n"; fwrite($myfile, $txt); $txt = "Jane Doe\n"; fwrite($myfile, $txt); fclose($myfile); // current directory echo getcwd() . "\n"; chdir('/tmp'); // current directory echo getcwd() . "\n"; $dir = '/etc/'; $files1 = scandir($dir); $files2 = scandir($dir, 1); print_r($files1); print_r($files2);

preferences:
36.86 ms | 402 KiB | 5 Q