3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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());

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
Warning: The magic method __call() must have public visibility and cannot be static in /in/6J7Je on line 3 foo object(ReflectionMethod)#2 (2) { ["name"]=> string(3) "foo" ["class"]=> string(1) "A" }
Output for Array change keys
Warning: The magic method __call() must have public visibility and cannot be static in /in/6J7Je on line 3 foo object(ReflectionMethod)#2 (2) { ["name"]=> string(3) "foo" ["class"]=> string(1) "A" }
Output for Lexical anon
Warning: The magic method __call() must have public visibility and cannot be static in /in/6J7Je on line 3 foo object(ReflectionMethod)#2 (2) { ["name"]=> string(3) "foo" ["class"]=> string(1) "A" }

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