3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $username = 'jobboard'; $password = 'games22'; $host = "db4free.net"; $dbname = 'jobboard'; try { $db = new PDO("mysql:host={$host};dbname={$dbname};charset=utf8", $username, $password); } catch(PDOException $ex) { die("Failed to connect to the database: " . $ex->getMessage()); }
Output for 5.1.0 - 7.1.0
Failed to connect to the database: could not find driver
Output for 5.0.0 - 5.0.5
Fatal error: Class 'PDO' not found in /in/DrZsO on line 10
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/DrZsO on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/DrZsO on line 9
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/DrZsO on line 9
Process exited with code 255.