3v4l.org

run code in 500+ 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.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.
Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.34, 8.3.0 - 8.3.5
Fatal error: Cannot make non static method A::getSomeInt() static in class B in /in/WnaES on line 12
Process exited with code 255.

preferences:
29.73 ms | 1140 KiB | 8 Q