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();
Output for git.master, git.master_jit, rfc.property-hooks
child

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:
64.66 ms | 401 KiB | 8 Q