3v4l.org

run code in 300+ PHP versions simultaneously
<?php // The difference between the $fnc() and call_user_func($fnc) class A { function foo() { echo 'foo'; } } class B extends A { function __call($name, $args) { $fnc = 'parent::foo'; call_user_func($fnc); // works $fnc(); // error Call to undefined function parent::foo() } } $b = new B; $b->bar();
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Use of "parent" in callables is deprecated in /in/iBMM2 on line 19 foo Fatal error: Uncaught Error: Class "parent" not found in /in/iBMM2:20 Stack trace: #0 /in/iBMM2(25): B->__call('bar', Array) #1 {main} thrown in /in/iBMM2 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:
108.96 ms | 401 KiB | 8 Q