3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dir = dir('/home'); while ($entry = $dir->read()) { echo $entry . "\n"; }
based on RGeFm
Output for 4.3.0, 5.4.39 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 5.6.28, hhvm-3.10.0, 7.0.0 - 7.0.3, 7.0.5 - 7.1.0
. ..
Output for 7.0.4
Warning: dir(/home): failed to open dir: Permission denied in /in/LUmim on line 2 Fatal error: Uncaught Error: Call to a member function read() on boolean in /in/LUmim:3 Stack trace: #0 {main} thrown in /in/LUmim on line 3
Process exited with code 255.
Output for hhvm-3.12.0
Warning: Permission denied in /in/LUmim on line 2 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function read() on a non-object (boolean)' in /in/LUmim:3 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.18 - 5.6.19
Warning: dir(/home): failed to open dir: Permission denied in /in/LUmim on line 2 Fatal error: Call to a member function read() on boolean in /in/LUmim on line 3
Process exited with code 255.
Output for 5.5.33
Warning: dir(/home): failed to open dir: Permission denied in /in/LUmim on line 2 Fatal error: Call to a member function read() on a non-object in /in/LUmim on line 3
Process exited with code 255.
Output for 5.4.34 - 5.4.38
. .. sjon
Output for 4.3.1 - 5.4.32
.. .