PHP - Functions
What will be the output of this PHP code?
function add($a, $b) {
return $a + $b;
echo "Done";
}
$result = add(3, 4);
echo $result;function add($a, $b) {
return $a + $b;
echo "Done";
}
$result = add(3, 4);
echo $result;return $a + $b; sends back 7 and stops the function, so echo "Done"; is never run.$result gets 7, and echo $result; prints 7 only.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions