3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { function __construct (string $a) { } } new a();
based on ma6DS
Output for 7.1.0 - 7.3.0beta1
Fatal error: Uncaught ArgumentCountError: Too few arguments to function a::__construct(), 0 passed in /in/GIKdf on line 9 and exactly 1 expected in /in/GIKdf:4 Stack trace: #0 /in/GIKdf(9): a->__construct() #1 {main} thrown in /in/GIKdf on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Fatal error: Uncaught TypeError: Argument 1 passed to a::__construct() must be of the type string, none given, called in /in/GIKdf on line 9 and defined in /in/GIKdf:4 Stack trace: #0 /in/GIKdf(9): a->__construct() #1 {main} thrown in /in/GIKdf on line 4
Process exited with code 255.
Output for hhvm-3.15.4
Warning: __construct() expects exactly 1 parameter, 0 given in /in/GIKdf on line 6
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 1 passed to a::__construct() must be an instance of string, none given, called in /in/GIKdf on line 9 and defined in /in/GIKdf on line 4
Process exited with code 255.