3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function test($option = null) {} } class B extends A { function test() {} }
Output for 8.0.1 - 8.0.15, 8.1.0 - 8.1.2
Fatal error: Declaration of B::test() must be compatible with A::test($option = null) in /in/PmUnp on line 8
Process exited with code 255.
Output for 7.4.0 - 7.4.27
Warning: Declaration of B::test() should be compatible with A::test($option = NULL) in /in/PmUnp on line 8

preferences:
157.79 ms | 1425 KiB | 7 Q