3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 = '/'; $files1 = scandir($dir); $files2 = scandir($dir, 1); print_r($files1); print_r($files2);