3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Enum { public function __construct(string ...$params) { var_dump($params); } } $e = new Enum('NEW', 'OCCUPIED', 'RESERVED', []);
based on jgGJ2
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 4 passed to Enum::__construct() must be of the type string, array given, called in /in/o4siB on line 11 and defined in /in/o4siB:5 Stack trace: #0 /in/o4siB(11): Enum->__construct('NEW', 'OCCUPIED', 'RESERVED', Array) #1 {main} thrown in /in/o4siB on line 5
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Catchable fatal error: Argument 1 passed to Enum::__construct() must be an instance of string, string given, called in /in/o4siB on line 11 and defined in /in/o4siB on line 5
Process exited with code 255.
Output for 5.4.10 - 5.5.35
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /in/o4siB on line 5
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '.', expecting '&' or T_VARIABLE in /in/o4siB on line 5
Process exited with code 255.