3v4l.org

run code in 300+ 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 8.0.17, 8.1.4
Fatal error: Declaration of B::example(): string must be compatible with A::example(): int in /in/n1q0G on line 10
Process exited with code 255.
Output for 7.0.0 - 7.0.15, 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
Process exited with code 255.

preferences:
166.09 ms | 1395 KiB | 27 Q