3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface i { function foo($a, $b); } class x { function foo() {} } class y extends x implements i { function foo($a = 1) {} }
Output for 8.5.0 - 8.5.8
Fatal error: Declaration of y::foo($a = 1) must be compatible with i::foo($a, $b) in /in/1Wari on line 12 Stack trace: #0 {main}
Process exited with code 255.
Output for 8.2.31 - 8.2.32, 8.3.0 - 8.3.32, 8.4.1 - 8.4.23
Fatal error: Declaration of y::foo($a = 1) must be compatible with i::foo($a, $b) in /in/1Wari on line 12
Process exited with code 255.

preferences:
47.67 ms | 771 KiB | 4 Q