Home »
MCQs »
PHP MCQs
Which is the correct syntax of defining a default argument value in PHP?
104. Which is the correct syntax of defining a default argument value in PHP?
- function function_name(type $argument_name : value) { /* function body*/ }
- function function_name(type $argument_name , value) { /* function body*/ }
- function function_name(type $argument_name = value) { /* function body*/ }
- All of the above
Answer: C) function function_name(type $argument_name = value) { /* function body*/ }
Explanation:
The syntax of defining a default argument value in PHP is:
function function_name(type $argument_name = value) {
/* function body*/
}