3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $files = new DirectoryIterator("/var"); foreach($files as $file) { print $file->getFilename() . "\n"; }
based on 8oddm
Output for 7.3.0rc3
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(): open_basedir restriction in effect. File(/var) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Sh6EG:3 Stack trace: #0 /in/Sh6EG(3): DirectoryIterator->__construct('/var') #1 {main} thrown in /in/Sh6EG on line 3
Process exited with code 255.
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.1.10, 7.3.0alpha1 - 7.3.0beta1
. .. lock mail run cache db empty games lib local log opt spool tmp
Output for 7.1.20, 7.2.6
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(): open_basedir restriction in effect. File(/var) is not within the allowed path(s): (/tmp:/in) in /in/Sh6EG:3 Stack trace: #0 /in/Sh6EG(3): DirectoryIterator->__construct('/var') #1 {main} thrown in /in/Sh6EG on line 3
Process exited with code 255.
Output for 7.2.0
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(/var): failed to open dir: Permission denied in /in/Sh6EG:3 Stack trace: #0 /in/Sh6EG(3): DirectoryIterator->__construct('/var') #1 {main} thrown in /in/Sh6EG on line 3
Process exited with code 255.