3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Normal constructor abstract class x { function __construct($a) {} } class y extends x { // OK function __construct($b, $c) {} } // abstract constructor abstract class x2 { abstract function __construct($a); } class y2 extends x2 { // KO function __construct($b, $c) {} } // With interface interface i3 { abstract function __construct($a); } class y3 implements i3 { // KO function __construct($b, $c) {} }
Output for 8.2.0 - 8.2.28, 8.3.0 - 8.3.22, 8.4.1 - 8.4.8
Fatal error: Declaration of y2::__construct($b, $c) must be compatible with x2::__construct($a) in /in/GAiN9 on line 20
Process exited with code 255.

preferences:
149.3 ms | 1345 KiB | 6 Q