3v4l.org

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