Kuis Kontrol Alur — PHP
Kuis materi Kontrol Alur di PHP — uji pemahamanmu dengan pertanyaan pilihan ganda, penjelasan jawaban, dan skor langsung. Main gratis di Hyper Sheets.
Pertanyaan di kuis ini
- Apa output dari:
$nilai = 85;
if ($nilai >= 80) { echo "A"; } elseif ($nilai >= 70) { echo "B"; } - Lengkapi switch:
switch ($hari) { ___ "Senin": echo "Hari kerja"; break; } - Apa output dari:
$x = 0; echo $x ? "ya" : "tidak"; - Apa output dari:
$x = "0"; if ($x) { echo "true"; } else { echo "false"; } - Apa output dari:
$x = "1";
echo match($x) { 1 => "int", "1" => "string", default => "?" };