3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $db = new PDO('sqlite::memory:'); $st = $db->query(" SELECT 'ReflectionFunction', 'phpinfo'"); $re = $st->fetch(PDO::FETCH_CLASS | PDO::FETCH_CLASSTYPE); $re->invoke();
based on 410d3
Output for 7.1.0
Fatal error: Uncaught ArgumentCountError: ReflectionFunction::__construct() expects exactly 1 parameter, 0 given in /in/fO5Ga:5 Stack trace: #0 [internal function]: ReflectionFunction->__construct() #1 /in/fO5Ga(5): PDOStatement->fetch(262152) #2 {main} thrown in /in/fO5Ga on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Fatal error: Uncaught TypeError: ReflectionFunction::__construct() expects exactly 1 parameter, 0 given in /in/fO5Ga:5 Stack trace: #0 [internal function]: ReflectionFunction->__construct() #1 /in/fO5Ga(5): PDOStatement->fetch(262152) #2 {main} thrown in /in/fO5Ga on line 5
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Warning: __construct() expects exactly 1 parameter, 0 given Notice: Undefined variable: name_or_closure Notice: Undefined variable: name_or_closure Notice: Undefined variable: name_or_closure Fatal error: Uncaught exception 'ReflectionException' with message 'ReflectionFunction::__construct expects a string or a Closure, got NULL' in /in/fO5Ga:5 Stack trace: #0 /in/fO5Ga(5): PDOStatement->fetch() #1 {main}
Process exited with code 255.
Output for 5.3.3 - 5.6.28
Warning: ReflectionFunction::__construct() expects exactly 1 parameter, 0 given in /in/fO5Ga on line 5 Fatal error: ReflectionFunction::invoke(): Internal error: Failed to retrieve the reflection object in /in/fO5Ga on line 6
Process exited with code 255.
Output for 5.1.0 - 5.1.3, 5.2.0 - 5.3.2
Warning: ReflectionFunction::__construct() expects exactly 1 parameter, 0 given in /in/fO5Ga on line 5 Fatal error: Internal error: Failed to retrieve the reflection object in /in/fO5Ga 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/fO5Ga:3 Stack trace: #0 /in/fO5Ga(3): PDO->__construct('sqlite::memory:') #1 {main} thrown in /in/fO5Ga on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'PDO' not found in /in/fO5Ga on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '|', expecting '(' in /in/fO5Ga on line 5
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/fO5Ga on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/fO5Ga on line 5
Process exited with code 255.