Which version of PHP introduced Try/catch Exception?
Correct answer
B. PHP 5
12 views
B. PHP 5
12 views
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.
Not sure why the answer is B? Ask here and get an explanation.