function addition(int $number1, int $number2): int
{
return $number1 + $number2;
}
print('<pre>');
print_r(addition(2, "10"));
print('</pre>');
As a result of above code, it gives me 12. But it should give me an error. Because the second parameter should be an int
. But I passed string
. Can anyone tell me what kind of behavior happen here?
Thanks in advance.