3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Greet { function speak(): string; } class Hello implements Greet { function speak() { return 'world'; } } new Hello();
Output for 8.5.0
Fatal error: Declaration of Hello::speak() must be compatible with Greet::speak(): string in /in/Pi1eW on line 9 Stack trace: #0 {main}
Process exited with code 255.
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.15
Fatal error: Declaration of Hello::speak() must be compatible with Greet::speak(): string in /in/Pi1eW on line 9
Process exited with code 255.

preferences:
59.19 ms | 407 KiB | 5 Q