3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class parentClass { public function __construct($array) { } } class child extends parentClass { public function __construct(array $array) { } } $p = new parentClass(); $c = new child();
based on paKfs
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function parentClass::__construct(), 0 passed in /in/5pSl6 on line 14 and exactly 1 expected in /in/5pSl6:3 Stack trace: #0 /in/5pSl6(14): parentClass->__construct() #1 {main} thrown in /in/5pSl6 on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Missing argument 1 for parentClass::__construct(), called in /in/5pSl6 on line 14 and defined in /in/5pSl6 on line 3 Fatal error: Uncaught TypeError: Argument 1 passed to child::__construct() must be of the type array, none given, called in /in/5pSl6 on line 15 and defined in /in/5pSl6:9 Stack trace: #0 /in/5pSl6(15): child->__construct() #1 {main} thrown in /in/5pSl6 on line 9
Process exited with code 255.
Output for 5.4.1 - 5.6.28
Warning: Missing argument 1 for parentClass::__construct(), called in /in/5pSl6 on line 14 and defined in /in/5pSl6 on line 3 Catchable fatal error: Argument 1 passed to child::__construct() must be of the type array, none given, called in /in/5pSl6 on line 15 and defined in /in/5pSl6 on line 9
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Warning: Missing argument 1 for parentClass::__construct(), called in /in/5pSl6 on line 14 and defined in /in/5pSl6 on line 3 Catchable fatal error: Argument 1 passed to child::__construct() must be an array, none given, called in /in/5pSl6 on line 15 and defined in /in/5pSl6 on line 9
Process exited with code 255.