3v4l.org

run code in 500+ PHP versions simultaneously
<?php echo new SplFileObject('example.txt'); ?>
Output for 8.5.0 - 8.5.9
Fatal error: Uncaught RuntimeException: SplFileObject::__construct(example.txt): Failed to open stream: No such file or directory in /in/iShTk:2 Stack trace: #0 /in/iShTk(2): SplFileObject->__construct('example.txt') #1 {main} thrown in /in/iShTk on line 2
Process exited with code 255.
Output for 8.2.31 - 8.2.33, 8.3.0 - 8.3.33, 8.4.1 - 8.4.24
Fatal error: Uncaught RuntimeException: SplFileObject::__construct(): open_basedir restriction in effect. File(example.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/iShTk:2 Stack trace: #0 /in/iShTk(2): SplFileObject->__construct('example.txt') #1 {main} thrown in /in/iShTk on line 2
Process exited with code 255.
Output for 5.6.0
Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileObject::__construct(): open_basedir restriction in effect. File(example.txt) is not within the allowed path(s): (/tmp:/in:/etc)' in /in/iShTk:2 Stack trace: #0 /in/iShTk(2): SplFileObject->__construct('example.txt') #1 {main} thrown in /in/iShTk on line 2
Process exited with code 255.

preferences:
52.84 ms | 804 KiB | 4 Q