Kuis Error Handling — PHP

Kuis materi Error Handling di PHP — uji pemahamanmu dengan pertanyaan pilihan ganda, penjelasan jawaban, dan skor langsung. Main gratis di Hyper Sheets.

Pertanyaan di kuis ini

  1. Tangkap exception:
    try { riskyCode(); } ___ (Exception $e) { echo $e->getMessage(); }
  2. Lempar exception:
    ___ new \RuntimeException("Data tidak ditemukan");
  3. Blok yang selalu dijalankan setelah try/catch:
    try { ... } catch (Exception $e) { ... } ___ { closeConnection(); }
  4. Apa output dari:
    try { throw new Exception("Gagal"); echo "A"; } catch (Exception $e) { echo "B"; } finally { echo "C"; }