Optional Function Parameters in PHP

Function parameters can be made optional. To do this, parameters need to be given default values. Let's say for example we have the following function:

php<?php
  function func($num) {
    echo $num ** 2;
  }
?>

Let's make it so that this parameter defaults to the value 0:

php<?php
  function func($num = 0) {
    echo $num ** 2;
  }
?>

Let's test our function with a parameter:

php<?php
  func(2); // outputs 4
?>

Let's test our function without a parameter:

php<?php
  func(); // outputs 0
?>
Задание 1

Given the function:

php<?php
  function func($num = 5) {
    echo $num * $num;
  }
?>

This function is called in the following way:

php<?php
  func(2);
  func(3);
  func();
?>

Explain what the result of each function call will be.

Задание 2

Given the function:

php<?php
  function func($num1 = 0, $num2 = 0) {
    echo $num1 + $num2;
  }
?>

This function is called in the following way:

php<?php
  func(2, 3);
  func(3);
  func();
?>

Explain what the result of each function call will be.