3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function __call($name, $args) { echo $name; } private function foo() { echo 'ahoj'; } } class B extends A { public function bar() { echo $this->foo()."\n"; } } $a = new B; $a->bar(); call_user_func(array($a, 'foo')); $ref = new ReflectionMethod($a, '__call'); $ref->setAccessible(true); $ref->invoke($a, 'foo', array()); //$ref = new ReflectionClass($a); //var_dump($ref->getMethods());
Output for git.master, git.master_jit
Warning: The magic method A::__call() must have public visibility in /in/J1pPL on line 3 foo foofoo
Output for rfc.property-hooks
Warning: The magic method A::__call() must have public visibility in /in/J1pPL on line 3 foo foo Fatal error: Uncaught ReflectionException: Method B::__call() does not exist in /in/J1pPL:23 Stack trace: #0 /in/J1pPL(23): ReflectionMethod->__construct(Object(B), '__call') #1 {main} thrown in /in/J1pPL on line 23
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
38.54 ms | 401 KiB | 8 Q