Priority of Mathematical Operations in PHP

Mathematical operations in PHP have the same priority as in regular mathematics. That is, multiplication and division are performed first, and only then addition and subtraction. In the following example, 2 will first be multiplied by 2 and then 3 will be added to the result:

php<?php
  $a = 2 * 2 + 3;
  echo $a; // outputs 7 (result of 4 + 3)
?>
Задание 1

Without running the code, determine what will be displayed on the screen:

php<?php
  $a = 5 + 5 * 3;
  echo $a;
?>
Задание 2

Without running the code, determine what will be displayed on the screen:

php<?php
  $a = 5 + 5 * 3 + 3;
  echo $a;
?>
Задание 3

Without running the code, determine what will be displayed on the screen:

php<?php
  $a = 8 / 2 + 2;
  echo $a;
?>
Задание 4

Without running the code, determine what will be displayed on the screen:

php<?php
  $a = 8 + 2 / 2;
  echo $a;
?>