Question from the PHP - Fundamentals test

Write a PHP function that adds two numbers and returns an integer.

Medium

What is the output of the following code ?

function addNumbers(float $a, float $b) : int {

return (int)($a + $b);

}

echo addNumbers(1.7, 5.2);
Author: ThéoStatus: PublishedQuestion passed 1412 times
Edit
2
Community EvaluationsNo one has reviewed this question yet, be the first!