3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function test($a, $b = null) { } } class B extends A { function test($a) { } }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
Fatal error: Declaration of B::test($a) must be compatible with A::test($a, $b = null) in /in/S575H on line 10
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Warning: Declaration of B::test($a) should be compatible with A::test($a, $b = NULL) in /in/S575H on line 10
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33
Warning: Declaration of B::test($a) should be compatible with A::test($a, $b = NULL) in /in/S575H on line 13

preferences:
141.36 ms | 409 KiB | 5 Q