3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // This contains ASCII 0x00 aka \0 $data = "x\0y"; $pdo = new PDO( "sqlite:test", '', '', array( PDO::ATTR_PERSISTENT => false ) ); $result = $pdo->quote( $data ); print "Raw: " . $result . "\n"; print "Hex: " . bin2hex( $result ) . "\n";
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught PDOException: SQLSTATE[HY000] [14] unable to open database file in /in/TQ7L1:6 Stack trace: #0 /in/TQ7L1(6): PDO->__construct('sqlite:test', '', '', Array) #1 {main} thrown in /in/TQ7L1 on line 6
Process exited with code 255.
Output for 5.1.0 - 5.1.3, 5.2.0 - 5.6.22
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [14] unable to open database file' in /in/TQ7L1:6 Stack trace: #0 /in/TQ7L1(6): PDO->__construct('sqlite:test', '', '', Array) #1 {main} thrown in /in/TQ7L1 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/TQ7L1:6 Stack trace: #0 /in/TQ7L1(6): PDO->__construct('sqlite:test', '', '', Array) #1 {main} thrown in /in/TQ7L1 on line 6
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'PDO' not found in /in/TQ7L1 on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting '(' in /in/TQ7L1 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 T_DOUBLE_ARROW, expecting '(' in /in/TQ7L1 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/TQ7L1 on line 6
Process exited with code 255.