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);

preferences:
42.7 ms | 402 KiB | 5 Q