3v4l.org

run code in 500+ PHP versions simultaneously
<?php class SomeParent { public function test(): static { return $this; } } final class SomeChild extends SomeParent { } $obj = new SomeChild(); var_dump($obj->test());
Output for 8.0.29, 8.1.23 - 8.1.34, 8.2.10 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
object(SomeChild)#1 (0) { }
Output for 7.0.33, 7.1.4, 7.2.20, 7.4.11
Parse error: syntax error, unexpected 'static' (T_STATIC) in /in/B61Io on line 5
Process exited with code 255.

preferences:
68.51 ms | 863 KiB | 4 Q