External Variables of Functions in PHP

Variables declared outside of a function are not visible inside. Let's look at an example. Suppose we have the following variable:

php<?php
  $num = 1;
?>

Let's try to output this variable inside a function:

php<?php
  $num = 1;
  
  function func()
  {
    echo $num;
  }
  
  func(); // error
?>
Задание 1

Explain what the result of the code execution will be:

php<?php
  $aaa = 111;
  
  function func()
  {
    echo $aaa;
  }
  
  func();
?>
Задание 2

Explain what the result of the code execution will be:

php<?php
  $num1 = 1;
  $num2 = 2;
  
  function func()
  {
    return $num1 + $num2;
  }
  
  echo func();
?>