3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public function x($args = []) {} } class B extends A { public function x() {} }
Output for 8.0.1 - 8.0.18, 8.1.0 - 8.1.5, 8.3.5
Fatal error: Declaration of B::x() must be compatible with A::x($args = []) in /in/kO2hW on line 8
Process exited with code 255.
Output for 7.4.0 - 7.4.29
Warning: Declaration of B::x() should be compatible with A::x($args = Array) in /in/kO2hW on line 8

preferences:
42.46 ms | 705 KiB | 3 Q