3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if ($dh = opendir(__DIR__)) { while ($file = readdir($dh)) { if (in_array($file, array('.', '..'))) continue; else echo $file . "\n"; } closedir($dh); }
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: opendir(/in): failed to open dir: Permission denied in /in/O5MHq on line 3
Output for hhvm-3.10.0 - 3.12.0
Warning: Permission denied in /in/O5MHq on line 3
Output for 4.3.2 - 5.2.17
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/O5MHq on line 3 Warning: opendir(__DIR__): failed to open dir: No such file or directory in /in/O5MHq on line 3
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/O5MHq on line 3 Warning: opendir(__DIR__) [http://www.php.net/function.opendir]: failed to open dir: No such file or directory in /in/O5MHq on line 3