3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait StaticCall { protected function callStatic($className, $methodName) { $parameters = func_get_args(); $parameters = array_slice($parameters, 2); return call_user_func_array($className . '::' . $methodName, $parameters); } } class Base { public function foo() { echo __METHOD__; } } class First extends Base { use StaticCall; public function foo() { #$this->callStatic('parent', 'foo'); call_user_func_array('parent::foo', array()); } } class Second extends First { use StaticCall; } $s = new Second(); $s->foo();
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Use of "parent" in callables is deprecated in /in/H2Qc0 on line 20 Base::foo

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