Concept
How do optional and default function parameters work in PHP?
ComputerScienceOne / Generalized Rounding
"7 8 //apr will be 0.05, terms will be 60 9 $x = getMonthlyPayment(10000); 10 print $x.\n\n\\\"; //188.71 11 12 //balance will be null (0), apr will be 0.05, terms will be 60 13 $x = getMonthlyPayment(); 14 print $x.\n\n\\\"; //0 but also a warning It would not be possible to invoke getMonthlyPayment() by omitting only the second argument. Providing n arguments will match the first n parameters. Thus, in your function design you should place any optional/default parameters last."
Related Ideas
- How do default parameter values work in PHP functions?ComputerScienceOne · Optional & Default Parameters
- How do omitted arguments match parameters in PHP functions?ComputerScienceOne · Function Pointers
- What happens when optional PHP function parameters are omitted?ComputerScienceOne · Optional & Default Parameters
- What are the key features of functions in PHP?ComputerScienceOne · Declaring Functions
- How can PHP default values let a constructor accept different numbers of parameters?ComputerScienceOne · Usage
- How do you declare functions and specify their return values in PHP?ComputerScienceOne · Declaring Functions
- How do you call a function in PHP?ComputerScienceOne · Calling Functions
- How does PHP handle undefined variables, null values, and constants?ComputerScienceOne · Using Variables