<?php
class IntBox
{
public $foo;
public function __construct(int $foo)
{
$this->foo = $foo;
}
public function __invoke()
{
return $this->foo;
}
}
$a = new IntBox(20);
$b = new IntBox(30);
echo $a() + $b();
Catchable fatal error: Argument 1 passed to IntBox::__construct() must be an instance of int, integer given, called in /in/uVqpe on line 19 and defined in /in/uVqpe on line 7
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Fatal error: Argument 1 passed to IntBox::__construct() must be an object of class int, called in /in/uVqpe on line 19 and defined in /in/uVqpe on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Argument 1 must be an object of class int in /in/uVqpe on line 7
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/uVqpe on line 5
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/uVqpe 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/uVqpe on line 5
Process exited with code 255.