3v4l.org

run code in 300+ PHP versions simultaneously
<?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/GNdM7 on line 16
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/EWqEb on line 16
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Deprecated: Call-time pass-by-reference has been deprecated in /in/EWqEb on line 16 Fatal error: Cannot redeclare a() (previously declared in /in/EWqEb:2) in /in/EWqEb on line 19
Process exited with code 255.

preferences:
193.21 ms | 1395 KiB | 55 Q