3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class integer { private $value; public function __construct(int $value) { $this->value = $value; } public function __invoke(...$value) { var_dump($value); } } $testi = new integer(1); $testi();
based on NcPGg
Output for 7.0.0 - 7.2.0
array(0) { }
Output for 5.6.8 - 5.6.28
Catchable fatal error: Argument 1 passed to integer::__construct() must be an instance of int, integer given, called in /in/a6CL7 on line 17 and defined in /in/a6CL7 on line 6
Process exited with code 255.
Output for 5.4.9 - 5.5.35
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /in/a6CL7 on line 11
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '.', expecting '&' or T_VARIABLE in /in/a6CL7 on line 11
Process exited with code 255.