3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php interface xi { public function bindColumn ($column ,&$param ); public function bindParam ($parameter ,&$variable ); public function bindValue ($parameter ,$value); public function closeCursor (); public function columnCount (); public function debugDumpParams (); public function errorCode (); public function errorInfo (); public function execute ( ); public function fetch (); public function fetchAll ( ); public function fetchColumn (); public function fetchObject (); public function getAttribute ($attribute ); public function getColumnMeta ($column ); public function nextRowset (); public function rowCount (); public function setAttribute ($attribute ,$value ); public function setFetchMode ($mode ); } class xc implements xi { public function bindColumn ($column ,&$param ){} public function bindParam ($parameter ,&$variable ){} public function bindValue ($parameter ,$value){} public function closeCursor (){} public function columnCount (){} public function debugDumpParams (){} public function errorCode (){} public function errorInfo (){} public function execute ( ){} public function fetch (){} public function fetchAll ( ){} public function fetchColumn (){} public function fetchObject (){} public function getAttribute ($attribute ){} public function getColumnMeta ($column ){} public function nextRowset (){} public function rowCount (){} public function setAttribute ($attribute ,$value ){} public function setFetchMode ($mode ){} } function foo(PDOStatement $x) { } foo(new xc);
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be an instance of PDOStatement, instance of xc given, called in /in/1u5F5 on line 46 and defined in /in/1u5F5:44 Stack trace: #0 /in/1u5F5(46): foo(Object(xc)) #1 {main} thrown in /in/1u5F5 on line 44
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Catchable fatal error: Argument 1 passed to foo() must be an instance of PDOStatement, xc given in /in/1u5F5 on line 45
Process exited with code 255.
Output for 5.2.0 - 5.6.28
Catchable fatal error: Argument 1 passed to foo() must be an instance of PDOStatement, instance of xc given, called in /in/1u5F5 on line 46 and defined in /in/1u5F5 on line 44
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Fatal error: Argument 1 passed to foo() must be an instance of PDOStatement, called in /in/1u5F5 on line 46 and defined in /in/1u5F5 on line 44
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'PDOStatement' not found in /in/1u5F5 on line 44
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING in /in/1u5F5 on line 2
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_STRING in /in/1u5F5 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/1u5F5 on line 2
Process exited with code 255.