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 a($a) { } $b = 3; a($b);
Output for 5.4.18 - 5.4.19
Fatal error: Call-time pass-by-reference has been removed in /in/CUH5I on line 5
Process exited with code 255.
Output for 5.4.0 - 5.4.17
Fatal error: Call-time pass-by-reference has been removed in /in/Mu30I on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Deprecated: Call-time pass-by-reference has been deprecated in /in/Mu30I on line 5 Deprecated: Call-time pass-by-reference has been deprecated in /in/Mu30I on line 16 Fatal error: Cannot redeclare a() (previously declared in /in/Mu30I:2) in /in/Mu30I on line 19
Process exited with code 255.