3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { static public function a() { return 1; } static public function geta() { return static::a(); } } class B extends A { static public function a() { return 2; } } echo B::geta();
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18, 8.3.0 - 8.3.6
2
Output for 5.3.0 - 5.3.24, 5.4.0 - 5.4.14
Fatal error: Constructor A::a() cannot be static in /in/ivmWO on line 14
Process exited with code 255.

preferences:
71.96 ms | 402 KiB | 67 Q