3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public int $someInt = 0; public function getSomeInt() : int { return $this->someInt; } } class B extends A { public static function getSomeInt() : int { return parent::getSomeInt(); } }
Output for 7.4.0 - 7.4.16, 8.0.0 - 8.0.3
Fatal error: Cannot make non static method A::getSomeInt() static in class B in /in/WnaES on line 12
Process exited with code 255.
Output for 7.3.0 - 7.3.27
Parse error: syntax error, unexpected 'int' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/WnaES on line 4
Process exited with code 255.

preferences:
177.31 ms | 1399 KiB | 56 Q