Nuances of Shorthand Operations in PHP

Note that in shorthand operations, comparison is performed using ==, not ===.

Задание 1

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

php<?php
  $test = 3;
  
  if ($test) {
    echo '+++';
  } else {
    echo '---';
  }
?>
Задание 2

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

php<?php
  $test = 'abc';
  
  if ($test) {
    echo '+++';
  } else {
    echo '---';
  }
?>
Задание 3

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

php<?php
  $test = '';
  
  if ($test) {
    echo '+++';
  } else {
    echo '---';
  }
?>
Задание 4

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

php<?php
  $test = 3 * 'abc';
  
  if ($test) {
    echo '+++';
  } else {
    echo '---';
  }
?>
Задание 5

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

php<?php
  $test = null;
  
  if ($test) {
    echo '+++';
  } else {
    echo '---';
  }
?>
Задание 6

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

php<?php
  $test = false;
  
  if ($test) {
    echo '+++';
  } else {
    echo '---';
  }
?>
Задание 7

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

php<?php
  $test;
  
  if ($test) {
    echo '+++';
  } else {
    echo '---';
  }
?>
Задание 8

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

php<?php
  $test = 0;
  
  if ($test) {
    echo '+++';
  } else {
    echo '---';
  }
?>
Задание 9

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

php<?php
  $test = '0';
  
  if ($test) {
    echo '+++';
  } else {
    echo '---';
  }
?>
Задание 10

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

php<?php
  $test = -1;
  
  if ($test) {
    echo '+++';
  } else {
    echo '---';
  }
?>