3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Base { protected static function whoami() { echo "Base "; } public static function whoareyou() { static::whoami(); } } class A extends Base { public static function test() { Base::whoareyou(); self::whoareyou(); parent::whoareyou(); A::whoreareyou(); static::whoareyou(); } public static function whoami() { echo "A "; } } class B extends A { public static function whoami() { echo "B "; } } B::test();
Output for 7.0.0 - 7.3.0rc3
Base B B Fatal error: Uncaught Error: Call to undefined method A::whoreareyou() in /in/aleQS:17 Stack trace: #0 /in/aleQS(33): A::test() #1 {main} thrown in /in/aleQS on line 17
Process exited with code 255.
Output for hhvm-3.15.4
Base B B Fatal error: Uncaught Error: Call to undefined method A::whoreareyou() in /in/aleQS:17 Stack trace: #0 /in/aleQS(33): A::test() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Base B B Fatal error: Call to undefined method A::whoreareyou() in /in/aleQS on line 17
Process exited with code 255.