3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function hi() { echo __CLASS__,' -> A'; } public static function test() { // self::hi(); // 调用当前A类 A::hi(); 输出 A -> A // static::hi(); // 调用子B类 B::hi()覆盖了A::hi(); 输出 B -> B static::child(); // 调用子B类 B::child() // self::child(); // Fatal error: Call to undefined method A::child() } } class B extends A { public static function hi() { echo __CLASS__,' -> B'; } public static function child() { echo 'child'; } } B::test(); A::test();
Output for git.master, git.master_jit, rfc.property-hooks
child Fatal error: Uncaught Error: Call to undefined method A::child() in /in/gf1vV:10 Stack trace: #0 /in/gf1vV(25): A::test() #1 {main} thrown in /in/gf1vV on line 10
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:
38.68 ms | 401 KiB | 8 Q