3v4l.org

run code in 500+ PHP versions simultaneously
<?php //interface I { // public function example(); //} class A { public function example(): int { } } class B extends A { public function example(): string { } // not compatible with A::example }
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.1
Fatal error: Declaration of B::example(): string must be compatible with A::example(): int in /in/n1q0G on line 11
Output for 8.0.17 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.34, 8.3.0 - 8.3.5
Fatal error: Declaration of B::example(): string must be compatible with A::example(): int in /in/n1q0G on line 10

preferences:
29.25 ms | 1140 KiB | 8 Q