3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //file_put_contents("php://filter/write=string.toupper/resource=/tmp/test/example.txt","Hello World"); foreach(new GlobIterator('/tmp/test/*', FilesystemIterator::SKIP_DOTS) as $file) { //echo $file.PHP_EOL; var_dump(file_get_contents($file)); }
Output for 5.3.29, 5.4.28 - 5.5.24, 5.5.27 - 5.5.28, 5.5.30 - 5.5.35, 5.6.11 - 5.6.12, 5.6.14 - 5.6.20, 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.1, 7.0.3, 7.0.14 - 7.1.0
Output for 5.5.25 - 5.5.26, 5.5.29, 5.6.8 - 5.6.10, 5.6.13, 5.6.21, 7.0.2, 7.0.4 - 7.0.6
string(11) "HELLO WORLD" string(0) "" string(0) "" string(0) ""
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.27
string(11) "HELLO WORLD"
Output for 5.0.0 - 5.2.17
Fatal error: Class 'GlobIterator' not found in /in/1euAp on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')', expecting '(' in /in/1euAp on line 3
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/1euAp on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/1euAp on line 3
Process exited with code 255.