3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $pdo = new PDO("sqlite::memory:"); $ppdo = clone $pdo; echo $ppdo->query("select 1")->fetchColumn();
Output for 5.1.0 - 5.1.3, 5.2.0 - 5.2.3, 5.4.0 - 5.6.40, 7.0.0 - 7.3.4

Process exited with code 139.
Output for hhvm-3.10.1 - 3.22.0
1
Output for 5.3.0 - 5.3.29
Warning: PDO::query(): SQLSTATE[00000]: No error: PDO constructor was not called in /in/MRCHQ on line 5 Fatal error: Call to a member function fetchColumn() on a non-object in /in/MRCHQ on line 5
Process exited with code 255.
Output for 5.2.4 - 5.2.17
Warning: PDO::query(): SQLSTATE[HY000]: General error: constructor arguments must be passed as an array in /in/MRCHQ on line 5 Warning: PDO::query(): SQLSTATE[HY000]: General error: failed to instantiate user supplied statement class in /in/MRCHQ on line 5 Fatal error: Call to a member function fetchColumn() on a non-object in /in/MRCHQ on line 5
Process exited with code 139.
Output for 5.1.4 - 5.1.6
Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /in/MRCHQ:3 Stack trace: #0 /in/MRCHQ(3): PDO->__construct('sqlite::memory:') #1 {main} thrown in /in/MRCHQ on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'PDO' not found in /in/MRCHQ on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_VARIABLE in /in/MRCHQ on line 4
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_VARIABLE in /in/MRCHQ on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/MRCHQ on line 4
Process exited with code 255.