3v4l.org

run code in 500+ PHP versions simultaneously
<?php class UserPref { public $theme; public $lang; } $obj = new UserPref(); $obj->theme = new SplFileObject('/flag', 'r'); $obj->lang = "zh"; echo base64_encode(serialize($obj)); ?>
Output for 8.5.0 - 8.5.7
Fatal error: Uncaught RuntimeException: SplFileObject::__construct(/flag): Failed to open stream: No such file or directory in /in/ASuYB:8 Stack trace: #0 /in/ASuYB(8): SplFileObject->__construct('/flag', 'r') #1 {main} thrown in /in/ASuYB on line 8
Process exited with code 255.
Output for 8.2.31, 8.3.0 - 8.3.31, 8.4.1 - 8.4.22
Fatal error: Uncaught RuntimeException: SplFileObject::__construct(): open_basedir restriction in effect. File(/flag) is not within the allowed path(s): (/tmp:/in:/etc) in /in/ASuYB:8 Stack trace: #0 /in/ASuYB(8): SplFileObject->__construct('/flag', 'r') #1 {main} thrown in /in/ASuYB on line 8
Process exited with code 255.

preferences:
57.47 ms | 766 KiB | 4 Q