3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Testing shutdown sequence function checkSqlite() { if (!$GLOBALS['pdo']) echo "PDO connection\n"; } $pdo = new PDO('sqlite:memory'); function shutdown() { checkSqlite(); echo "register_shutdown_function\n"; } register_shutdown_function('shutdown'); class MyClass { function __destruct() { checkSqlite(); echo "Object destructor\n"; } } function obcallback($buffer) { checkSqlite(); $buffer .= "Output buffer callback\n"; return $buffer; } ob_start('obcallback'); $myObject = new MyClass; function dummy() { return true; } function sessionclose() { checkSqlite(); echo "Session close\n"; return true; } function sessionwrite() { checkSqlite(); echo "Session write\n"; return true; } session_set_save_handler('dummy','sessionclose','dummy','sessionwrite','dummy','dummy'); session_start(); ?>
based on 83BAY
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught PDOException: SQLSTATE[HY000] [14] unable to open database file in /in/mcl9B:10 Stack trace: #0 /in/mcl9B(10): PDO->__construct('sqlite:memory') #1 {main} thrown in /in/mcl9B on line 10
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [14] unable to open database file' in /in/mcl9B:10 Stack trace: #0 /in/mcl9B(10): PDO->__construct('sqlite:memory') #1 {main} thrown in /in/mcl9B on line 10
Process exited with code 255.