3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d = dir('/usr'); while ($v = $d->read()) { echo "$v\n"; } $d->close();
Output for 5.6.28, 7.0.14 - 7.1.0
. .. bin include lib local share src lib64 sbin
Output for 5.5.24 - 5.5.31, 5.5.34 - 5.6.17, 5.6.20 - 5.6.21, hhvm-3.10.0, 7.0.0 - 7.0.3, 7.0.5 - 7.0.6
. .. lib64 sbin bin include lib local share src
Output for 7.0.4
Warning: dir(/usr): failed to open dir: Permission denied in /in/TcP36 on line 2 Fatal error: Uncaught Error: Call to a member function read() on boolean in /in/TcP36:3 Stack trace: #0 {main} thrown in /in/TcP36 on line 3
Process exited with code 255.
Output for hhvm-3.12.0
Warning: Permission denied in /in/TcP36 on line 2 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function read() on a non-object (boolean)' in /in/TcP36:3 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.18 - 5.6.19
Warning: dir(/usr): failed to open dir: Permission denied in /in/TcP36 on line 2 Fatal error: Call to a member function read() on boolean in /in/TcP36 on line 3
Process exited with code 255.
Output for 5.0.0 - 5.4.45, 5.5.32 - 5.5.33
Warning: dir(/usr): failed to open dir: Permission denied in /in/TcP36 on line 2 Fatal error: Call to a member function read() on a non-object in /in/TcP36 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: dir(/usr): failed to open dir: Permission denied in /in/TcP36 on line 2 Fatal error: Call to a member function on a non-object in /in/TcP36 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: dir(/usr) [http://www.php.net/function.dir]: failed to open dir: Permission denied in /in/TcP36 on line 2 Fatal error: Call to a member function on a non-object in /in/TcP36 on line 3