Modifying External Variables of Anonymous Functions in PHP

External variables modified inside an anonymous function will not change outside:

php<?php
  $num = 1;
  
  $func = function() use ($num)
  {
    $num = 2;
  };
  
  $func();
  echo $num; // 1
?>

For the changes to apply, the variable must be passed by reference:

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

Fix the code so that it works as intended:

php<?php
  $num1 = 2;
  $num2 = 3;
  
  $func = function() use ($num1, $num2)
  {
    $num1 = $num1 ** 2;
    $num2 = $num2 ** 2;
  };
  
  $func();
  echo $num1;
  echo $num2;
?>