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(); var_dump(new ReflectionMethod($a, 'foo')); //$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/6J7Je on line 3 foo object(ReflectionMethod)#2 (2) { ["name"]=> string(3) "foo" ["class"]=> string(1) "A" }
Output for rfc.property-hooks
Warning: The magic method A::__call() must have public visibility in /in/6J7Je on line 3 foo Fatal error: Uncaught ReflectionException: Method B::foo() does not exist in /in/6J7Je:20 Stack trace: #0 /in/6J7Je(20): ReflectionMethod->__construct(Object(B), 'foo') #1 {main} thrown in /in/6J7Je on line 20
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:
47.56 ms | 401 KiB | 8 Q