3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class BaseClass { function __construct($val, $var) { print "Конструктор класса BaseClass\n"; } } class SubClass extends BaseClass { function __construct($val, $var, $myvar) { parent::__construct(); print "Конструктор класса SubClass\n"; } } // In BaseClass constructor $obj = new BaseClass(); // In BaseClass constructor // In SubClass constructor $obj = new SubClass();
based on R2oEa
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function BaseClass::__construct(), 0 passed in /in/SqR9I on line 17 and exactly 2 expected in /in/SqR9I:3 Stack trace: #0 /in/SqR9I(17): BaseClass->__construct() #1 {main} thrown in /in/SqR9I on line 3
Process exited with code 255.
Output for 5.3.21 - 7.0.20
Warning: Missing argument 1 for BaseClass::__construct(), called in /in/SqR9I on line 17 and defined in /in/SqR9I on line 3 Warning: Missing argument 2 for BaseClass::__construct(), called in /in/SqR9I on line 17 and defined in /in/SqR9I on line 3 Конструктор класса BaseClass Warning: Missing argument 1 for SubClass::__construct(), called in /in/SqR9I on line 21 and defined in /in/SqR9I on line 9 Warning: Missing argument 2 for SubClass::__construct(), called in /in/SqR9I on line 21 and defined in /in/SqR9I on line 9 Warning: Missing argument 3 for SubClass::__construct(), called in /in/SqR9I on line 21 and defined in /in/SqR9I on line 9 Warning: Missing argument 1 for BaseClass::__construct(), called in /in/SqR9I on line 10 and defined in /in/SqR9I on line 3 Warning: Missing argument 2 for BaseClass::__construct(), called in /in/SqR9I on line 10 and defined in /in/SqR9I on line 3 Конструктор класса BaseClass Конструктор класса SubClass