3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private static function __invoke() { 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.0 - 5.4.19
Fatal error: Call-time pass-by-reference has been removed in /in/gMrfv on line 10
Process exited with code 255.
Output for 5.3.2 - 5.3.29
Deprecated: Call-time pass-by-reference has been deprecated in /in/gMrfv on line 10 bool(true) bool(true) aa
Output for 5.3.0 - 5.3.1
Deprecated: Call-time pass-by-reference has been deprecated in /in/gMrfv on line 10 bool(true) bool(true) a Fatal error: Call to undefined method ReflectionMethod::setAccessible() in /in/gMrfv on line 8
Process exited with code 255.

preferences:
179.12 ms | 1399 KiB | 57 Q