3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait SomeTrait { public function __call($method, array $parameters) { // ... return is_callable(['parent', '__call']) ? parent::__call($method, $parameters) : null; } } class GreatParentClass { public function __call($method, array $parameters) { return 'bar'; } } class ParenClassWithoutCall { } class ProxyClass extends GreatParentClass { } class FooClass extends ProxyClass { use SomeTrait; } class BarClass extends GreatParentClass { use SomeTrait; } class BazClass extends ParenClassWithoutCall { use SomeTrait; } class SomeClassWithoutParent { use SomeTrait; } $class = new FooClass(); var_dump($class->foobar()); $class = new BarClass(); var_dump($class->foobar()); $class = new BazClass(); var_dump($class->foobar()); $class = new SomeClassWithoutParent(); var_dump($class->foobar());
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Use of "parent" in callables is deprecated in /in/R8hI3 on line 8 string(3) "bar" Deprecated: Use of "parent" in callables is deprecated in /in/R8hI3 on line 8 string(3) "bar" Deprecated: Use of "parent" in callables is deprecated in /in/R8hI3 on line 8 NULL NULL

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:
48.52 ms | 401 KiB | 8 Q