PHP - Functions
Identify the error in this PHP function:
function multiply($x, $y) {
$product = $x * $y;
return
$product;
}function multiply($x, $y) {
$product = $x * $y;
return
$product;
}return is on one line alone, so PHP treats it as returning nothing immediately.$product; is unreachable and not part of return, causing function to return null.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions