3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function __callStatic($name, $args) { echo "Static\n"; } } class B extends A { public function test() { forward_static_call(array('A', 'stuff')); call_user_func(array('A', 'stuff')); A::stuff(); } } class C { public function test() { forward_static_call(array('A', 'stuff')); call_user_func(array('A', 'stuff')); A::stuff(); } } A::test(); echo " = B =\n"; $b = new B(); $b->test(); echo " = C =\n"; $c = new C(); $c->test();
Output for git.master, git.master_jit, rfc.property-hooks
Static = B = Fatal error: Uncaught TypeError: forward_static_call(): Argument #1 ($callback) must be a valid callback, class A does not have a method "stuff" in /in/Ummp7:15 Stack trace: #0 /in/Ummp7(15): forward_static_call(Array) #1 /in/Ummp7(35): B->test() #2 {main} thrown in /in/Ummp7 on line 15
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:
45.14 ms | 401 KiB | 8 Q