0

I set return type to int and i put 5.2 and 4.8 that the value will be 10 and its 'int' but why it returns fatal error?

<?php declare(strict_types=1);
function jmp(float $n1,float $n2) : int {
return $n1 + $n2;
}
echo jmp(5.2,4.8);
?>
jasmine
  • 57
  • 5

0 Answers0