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', 1);
based on XF7Xv
Output for 7.0.0 - 7.2.0
array(4) { [0]=> string(3) "NEW" [1]=> string(8) "OCCUPIED" [2]=> string(8) "RESERVED" [3]=> string(1) "1" }
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/jgGJ2 on line 11 and defined in /in/jgGJ2 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/jgGJ2 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/jgGJ2 on line 5
Process exited with code 255.