3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function __construct() { } } class Bar extends Foo { public function __construct($aa, $bb) { } } $bar = new Bar(); (function (Foo $foo) { $foo->__construct(); })($bar);
based on kbl3e
Output for 7.1.0 - 7.3.0rc3
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Bar::__construct(), 0 passed in /in/A2eov on line 21 and exactly 2 expected in /in/A2eov:15 Stack trace: #0 /in/A2eov(21): Bar->__construct() #1 {main} thrown in /in/A2eov on line 15
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Missing argument 1 for Bar::__construct(), called in /in/A2eov on line 21 and defined in /in/A2eov on line 15 Warning: Missing argument 2 for Bar::__construct(), called in /in/A2eov on line 21 and defined in /in/A2eov on line 15 Warning: Missing argument 1 for Bar::__construct(), called in /in/A2eov on line 23 and defined in /in/A2eov on line 15 Warning: Missing argument 2 for Bar::__construct(), called in /in/A2eov on line 23 and defined in /in/A2eov on line 15
Output for hhvm-3.15.4
Warning: __construct() expects exactly 2 parameters, 0 given in /in/A2eov on line 18 Warning: __construct() expects exactly 2 parameters, 0 given in /in/A2eov on line 18
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected '(' in /in/A2eov on line 24
Process exited with code 255.