3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Foo { public static function a(); public static function b($arg); } abstract class Base implements Foo { public static function a() { return __FUNCTION__ . '(' . __LINE__ . ')'; } } class Concrete extends Base { public static function b($arg) { return array(__FUNCTION__, __LINE__, $arg); } } var_dump(Concrete::a()); // works var_dump(Base::a()); // works var_dump(Concrete::b(__LINE__)); // works var_dump(Base::b(__LINE__)); // can't call an abstract method
Output for git.master, git.master_jit, rfc.property-hooks
string(5) "a(10)" string(5) "a(10)" array(3) { [0]=> string(1) "b" [1]=> int(16) [2]=> int(22) } Fatal error: Uncaught Error: Cannot call abstract method Foo::b() in /in/4EKo2:23 Stack trace: #0 {main} thrown in /in/4EKo2 on line 23
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:
65.23 ms | 405 KiB | 5 Q