3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function bar() : void {} } class B extends A { public function bar() : int {} }
Output for 7.4.0 - 7.4.4
Fatal error: Declaration of B::bar(): int must be compatible with A::bar(): void in /in/O0qhT on line 9
Process exited with code 255.
Output for 7.2.0 - 7.2.29, 7.3.0 - 7.3.16
Fatal error: Declaration of B::bar(): int must be compatible with A::bar(): void in /in/O0qhT on line 10
Process exited with code 255.

preferences:
195.21 ms | 1387 KiB | 59 Q