Question 73
The following PHP script is designed to subtract two indexed arrays of numbers.
Which statement is correct?
$a = array(5, 2, 2, 3);
$b = array(5, 8, 1, 5);
var_dump(subArrays($a, $b));
function
subArrays($arr1,
$arr2)
{
$c = count($arr1);
if
($c != count($arr2))
return
null;
for($i = 0;
$i < $c;
$i++)
$res[$i]
$arr1[$i] - $arr2[$i];
return $res;
\}
?>
A. The script is valid.
B. Assignments must be made on a single line.
C. It has too many linefeed characters between statements.
D. No, the script is missing curly braces.
E. Yes it is valid, but the script will not work as expected.