3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //mkdir('/tmp/test'); exec("echo 'ddd' > /tmp/test/ddd.txt"); foreach(new GlobIterator('/tmp/test/*', FilesystemIterator::SKIP_DOTS) as $file) { echo $file.PHP_EOL; //var_dump(file_get_contents($file)); }
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.27, 5.4.44 - 5.4.45, 5.5.27 - 5.5.28, 5.5.30 - 5.6.7, 5.6.11 - 5.6.12, 5.6.14 - 5.6.19, 5.6.28 - 7.0.3, 7.0.14 - 7.2.8
Output for 5.5.24 - 5.5.26, 5.6.8 - 5.6.9, 5.6.20, 7.0.6
/tmp/test/example.txt /tmp/test/file1.php /tmp/test/folder /tmp/test/mydir
Output for 5.5.29, 5.6.10, 5.6.13, 5.6.21, 7.0.4 - 7.0.5
/tmp/test/mydir
Output for 5.3.29, 5.4.28 - 5.4.43
sh: 1: cannot create /tmp/test/ddd.txt: Directory nonexistent
Output for 5.0.0 - 5.2.17
Fatal error: Class 'GlobIterator' not found in /in/CZQca on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')', expecting '(' in /in/CZQca on line 4
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/CZQca on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/CZQca on line 4
Process exited with code 255.