3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $files = new DirectoryIterator("/var/www"); foreach($files as $file) { print $file->getFilename() . "\n"; }
based on CpYFH
Output for 7.3.0rc3
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(): open_basedir restriction in effect. File(/var/www) is not within the allowed path(s): (/tmp:/in:/etc) in /in/n4FSK:3 Stack trace: #0 /in/n4FSK(3): DirectoryIterator->__construct('/var/www') #1 {main} thrown in /in/n4FSK on line 3
Process exited with code 255.
Output for 7.1.10, 7.2.0, 7.3.0alpha1 - 7.3.0beta1
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(/var/www): failed to open dir: No such file or directory in /in/n4FSK:3 Stack trace: #0 /in/n4FSK(3): DirectoryIterator->__construct('/var/www') #1 {main} thrown in /in/n4FSK on line 3
Process exited with code 255.
Output for 7.1.20, 7.2.6
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(): open_basedir restriction in effect. File(/var/www) is not within the allowed path(s): (/tmp:/in) in /in/n4FSK:3 Stack trace: #0 /in/n4FSK(3): DirectoryIterator->__construct('/var/www') #1 {main} thrown in /in/n4FSK on line 3
Process exited with code 255.
Output for 7.0.0 - 7.1.7
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(): open_basedir restriction in effect. File(/var/www) is not within the allowed path(s): (/tmp/) in /in/n4FSK:3 Stack trace: #0 /in/n4FSK(3): DirectoryIterator->__construct('/var/www') #1 {main} thrown in /in/n4FSK on line 3
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(/var/www): failed to open dir' in /in/n4FSK:3 Stack trace: #0 /in/n4FSK(3): DirectoryIterator->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(): open_basedir restriction in effect. File(/var/www) is not within the allowed path(s): (/tmp/)' in /in/n4FSK:3 Stack trace: #0 /in/n4FSK(3): DirectoryIterator->__construct('/var/www') #1 {main} thrown in /in/n4FSK on line 3
Process exited with code 255.