Sometimes functions with parameters need to be set with a default value to make it optional.
// Function with Params Default value
function sum($x,$y=5){
$num1=$x;
$num2=$y;
echo $num1+$num2.”\n”;
}
sum(2);
sum(5,9);
Here $y=5 is the default value of parameter $y.