3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Base { protected static string $message; public static function f() : void { echo static::$message; } } final class Test extends Base { protected static string $message = "Okey :)"; } Base::f(); ?>
Output for 8.2.0 - 8.2.28, 8.3.0 - 8.3.22, 8.4.1 - 8.4.8
Fatal error: Uncaught Error: Typed static property Base::$message must not be accessed before initialization in /in/H8Yh3:5 Stack trace: #0 /in/H8Yh3(11): Base::f() #1 {main} thrown in /in/H8Yh3 on line 5
Process exited with code 255.

preferences:
44.5 ms | 406 KiB | 5 Q