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

preferences:
27.45 ms | 405 KiB | 5 Q