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(int ...$value) { var_dump($value); } } $testi = new integer(1); $testi('dsa');
based on KgNv5
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to integer::__invoke() must be of the type integer, string given, called in /in/usOQv on line 18 and defined in /in/usOQv:11 Stack trace: #0 /in/usOQv(18): integer->__invoke('dsa') #1 {main} thrown in /in/usOQv on line 11
Process exited with code 255.
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/usOQv on line 17 and defined in /in/usOQv 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/usOQv 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/usOQv on line 11
Process exited with code 255.