3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $projectRoot = sys_get_temp_dir() . "/test2"; mkdir($projectRoot, 0777, true); touch("$projectRoot/file1.php"); mkdir("$projectRoot/folder", 0777, true); touch("$projectRoot/folder/evenmoar.php"); touch("$projectRoot/folder/moarcode.php"); chdir($projectRoot); $dirIterator = new RecursiveDirectoryIterator(".", FilesystemIterator::SKIP_DOTS); $iterator = new RecursiveIteratorIterator($dirIterator); foreach($iterator as $file) { echo $file; }
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
./folder/moarcode.php./folder/evenmoar.php./file1.php
Output for 5.2.1 - 5.2.17
Fatal error: Class 'FilesystemIterator' not found in /in/7ADiJ on line 11
Process exited with code 255.
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function sys_get_temp_dir() in /in/7ADiJ on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')', expecting '(' in /in/7ADiJ on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected ')', expecting '(' in /in/7ADiJ on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/7ADiJ on line 11
Process exited with code 255.