3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $pdo = new PDO('sqlite::memory:'); $sql = 'SELECT sqlite_version() as version;'; echo $pdo->query($sql, PDO::FETCH_COLUMN, 0);
Output for 7.1.0
Recoverable fatal error: Object of class PDOStatement could not be converted to string in /in/R4ROj on line 6
Process exited with code 255.
Output for 5.2.0 - 7.0.14
Catchable fatal error: Object of class PDOStatement could not be converted to string in /in/R4ROj on line 6
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/R4ROj:2 Stack trace: #0 /in/R4ROj(2): PDO->__construct('sqlite::memory:') #1 {main} thrown in /in/R4ROj on line 2
Process exited with code 255.
Output for 5.1.0 - 5.1.3
Object id #2
Output for 5.0.0 - 5.0.5
Fatal error: Class 'PDO' not found in /in/R4ROj on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ',', expecting '(' in /in/R4ROj on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected ',', expecting '(' in /in/R4ROj on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/R4ROj on line 6
Process exited with code 255.