3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Advert { protected $id; protected $headline; protected $text; protected $url; protected $billing; protected $remaining; protected $total; public function __construct(array $data) { echo "<pre>" . print_r(get_class_vars($this), true) . "</pre>"; } } $x = new Advert();
Output for 7.1.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Advert::__construct(), 0 passed in /in/FRHLg on line 18 and exactly 1 expected in /in/FRHLg:13 Stack trace: #0 /in/FRHLg(18): Advert->__construct() #1 {main} thrown in /in/FRHLg on line 13
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Fatal error: Uncaught TypeError: Argument 1 passed to Advert::__construct() must be of the type array, none given, called in /in/FRHLg on line 18 and defined in /in/FRHLg:13 Stack trace: #0 /in/FRHLg(18): Advert->__construct() #1 {main} thrown in /in/FRHLg on line 13
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Warning: __construct() expects exactly 1 parameter, 0 given in /in/FRHLg on line 15 Catchable fatal error: Argument 1 passed to Advert::__construct() must be an instance of array, undefined variable given in /in/FRHLg on line 15
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Catchable fatal error: Argument 1 passed to Advert::__construct() must be of the type array, none given, called in /in/FRHLg on line 18 and defined in /in/FRHLg on line 13
Process exited with code 255.
Output for 5.2.0 - 5.3.29
Catchable fatal error: Argument 1 passed to Advert::__construct() must be an array, none given, called in /in/FRHLg on line 18 and defined in /in/FRHLg on line 13
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Fatal error: Argument 1 passed to Advert::__construct() must be an array, called in /in/FRHLg on line 18 and defined in /in/FRHLg on line 13
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in /in/FRHLg on line 13
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/FRHLg on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/FRHLg on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/FRHLg on line 5
Process exited with code 255.