3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(new DirectoryIterator(dirname(__FILE__)));
Output for 7.3.32 - 7.3.33, 7.4.26 - 7.4.33, 8.0.13 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
object(DirectoryIterator)#1 (4) { ["pathName":"SplFileInfo":private]=> string(5) "/in/." ["fileName":"SplFileInfo":private]=> string(1) "." ["glob":"DirectoryIterator":private]=> bool(false) ["subPathName":"RecursiveDirectoryIterator":private]=> string(0) "" }
Output for 8.0.0 - 8.0.12
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(/in): Failed to open directory: Permission denied in /in/UJpeE:3 Stack trace: #0 /in/UJpeE(3): DirectoryIterator->__construct('/in') #1 {main} thrown in /in/UJpeE on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25
Fatal error: Uncaught UnexpectedValueException: DirectoryIterator::__construct(/in): failed to open dir: Permission denied in /in/UJpeE:3 Stack trace: #0 /in/UJpeE(3): DirectoryIterator->__construct('/in') #1 {main} thrown in /in/UJpeE on line 3
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(/in): failed to open dir: Permission denied' in /in/UJpeE:3 Stack trace: #0 /in/UJpeE(3): DirectoryIterator->__construct('/in') #1 {main} thrown in /in/UJpeE on line 3
Process exited with code 255.

preferences:
280.73 ms | 402 KiB | 339 Q