3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); $db = new PDO('mysql:host=localhostes;dbname=testdb;charset=utf8', 'root', '', array(PDO::ATTR_EMULATE_PREPARES => false, //PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ));
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught PDOException: could not find driver in /in/tBN04:3 Stack trace: #0 /in/tBN04(3): PDO->__construct('mysql:host=loca...', 'root', '', Array) #1 {main} thrown in /in/tBN04 on line 3
Process exited with code 255.
Output for 5.1.3 - 5.6.28
Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /in/tBN04:5 Stack trace: #0 /in/tBN04(5): PDO->__construct('mysql:host=loca...', 'root', '', Array) #1 {main} thrown in /in/tBN04 on line 5
Process exited with code 255.
Output for 5.1.0 - 5.1.2
Fatal error: Undefined class constant 'ATTR_EMULATE_PREPARES' in /in/tBN04 on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'PDO' not found in /in/tBN04 on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting '(' in /in/tBN04 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_DOUBLE_ARROW, expecting '(' in /in/tBN04 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/tBN04 on line 3
Process exited with code 255.