1. Home
  2. Computer Science MCQs
  3. PHP
  4. Which version of PHP introduced Try/catch Exception?

Added 19 Jan 2024

Which version of PHP introduced Try/catch Exception?

  1. PHP 4
  2. PHP 5 Correct answer
  3. PHP 5.3
  4. PHP 6

Correct answer

B. PHP 5

12 views

MCQSEXAM

Explanation

PHP 5 introduced the try/catch exception model along with its completely rewritten object model (Zend Engine 2). Before that, PHP 4 relied on return values and trigger_error() for error handling.

Later versions refined it — PHP 5.5 added finally and PHP 7 added the Throwable interface — but structured exception handling itself dates from PHP 5.

For more solved questions like this one, see Computer Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More PHP MCQs

Practise all PHP MCQs

Similar MCQs