Konstruksi if-else dan Nilai Boolean

Misalkan kita memiliki variabel boolean tertentu, yang dapat menerima nilai true atau false:

php<?php
  $test = true;
?>

Mari kita tulis if yang memeriksa variabel kita untuk nilai true:

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

Periksa bahwa variabel $test sama dengan true.

Задание 2

Periksa bahwa variabel $test sama dengan false.