PHP MCQ Functions in PHP MCQ Question #2430
Single Choice Not Set

QWhat will be the output of the following PHP code?
< ?php 
    function calc($price, $tax="")
    {
        $total = $price + ($price * $tax);
        echo "$total"; 
    }
    calc(42);	
?>

ID: #2430 Functions in PHP MCQ 2,255 views
Question Info
#2430Q ID
Not SetDifficulty
Functions in PHP MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Error
  • C 42
  • D 84
Correct Answer

Explanation

You can designate certain arguments as optional by placing them at the end of the list and assigning them a default value of nothing.

Share This Question

Challenge a friend or share with your study group.