3v4l.org

run code in 300+ 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
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:
153.23 ms | 1436 KiB | 7 Q