3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function a() {echo "a";} $a= 3; $f = "a"; $$f($a); exit; class A { private static function __invke() { echo "a"; }};//function() {}; $a = new A; //$a = function() { echo "b";}; $ref = new ReflectionMethod($a, '__invoke'); var_dump(is_object($a), is_callable($a)); $a(); $ref->setAccessible(true); $b = 3; $ref->invoke($a, $b); exit; function ab($a) { } $b = 3; a($b);
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Function name must be a string in /in/raeDl:5 Stack trace: #0 {main} thrown in /in/raeDl on line 5
Process exited with code 255.
Output for 5.2.3 - 5.6.28
Fatal error: Function name must be a string in /in/raeDl on line 5
Process exited with code 255.
Output for 5.0.0 - 5.2.2
<br /> <b>Fatal error</b>: Function name must be a string in <b>/in/raeDl</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.4.2 - 4.4.9
<br /> <b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/raeDl</b> on line <b>8</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
<br /> <b>Parse error</b>: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/in/raeDl</b> on line <b>8</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in <b>/in/raeDl</b> on line <b>8</b><br />
Process exited with code 255.