3v4l.org

run code in 200+ PHP versions simultaneously
<?php class A{ public static function foo(){ echo "in a \n"; } public static function test(){ static::foo(); } } class B extends A{ public static function foo(){ echo "in b \n"; } } function getIt($instance){ $instance::test(); } getIt(new A); getIt(new B);
Output for 7.1.25 - 7.3.1
in a in b