3v4l.org

run code in 200+ PHP versions simultaneously
<?php $db = new PDO('sqlite:');
Output for 5.2.14 - 5.2.17, 5.3.3 - 7.4.0
Output for 5.2.4 - 5.2.13, 5.3.0 - 5.3.2
Fatal error: Uncaught exception 'PDOException' with message 'safe_mode/open_basedir prohibits opening ' in /in/o1k3M:3 Stack trace: #0 /in/o1k3M(3): PDO->__construct('sqlite:') #1 {main} thrown in /in/o1k3M on line 3
Process exited with code 255.
Output for 5.1.0 - 5.1.3, 5.2.0 - 5.2.3
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [14] unable to open database file' in /in/o1k3M:3 Stack trace: #0 /in/o1k3M(3): PDO->__construct('sqlite:') #1 {main} thrown in /in/o1k3M on line 3
Process exited with code 255.
Output for 5.1.4 - 5.1.6
Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /in/o1k3M:3 Stack trace: #0 /in/o1k3M(3): PDO->__construct('sqlite:') #1 {main} thrown in /in/o1k3M on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'PDO' not found in /in/o1k3M on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: pdo in /in/o1k3M on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: pdo in /in/o1k3M on line 3