3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class a { public static function a() { self::$hoge = new static; } } class b extends a { } b::a(); var_dump(a::$hoge, b::$hoge);
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18, 8.3.0 - 8.3.7
Fatal error: Uncaught Error: Access to undeclared static property a::$hoge in /in/pkZHN:6 Stack trace: #0 /in/pkZHN(15): a::a() #1 {main} thrown in /in/pkZHN on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.21
Fatal error: Constructor a::a() cannot be static in /in/pkZHN on line 9
Process exited with code 255.

preferences:
100.4 ms | 402 KiB | 78 Q