3v4l.org

run code in 300+ PHP versions simultaneously
<?php spl_autoload_register(function($class) { if ($class === 'A') { class A { public function foo($x): B { return new B; } } } else if ($class === 'B') { class B extends A { public function foo($x): C { return new C; } } } else if ($class === 'C') { class C extends B implements N { } } }); new B;
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: During inheritance of B, while autoloading C: Uncaught Error: Interface "N" not found in /in/jMYYP:17 Stack trace: #0 /in/jMYYP(11): {closure}('C') #1 /in/jMYYP(22): {closure}('B') #2 {main} in /in/jMYYP on line 11
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:
97.16 ms | 1499 KiB | 4 Q