New features of PHP 5.5 – try, catch and finally.

Published on : April 27, 2026

Author:

Category: PHP


Try-catch blocks now support a finally block for cod. The finally block is executed even if an unexpected exception occurs.

php 5.5
php 5.5 try, catch, finally

[sourcecode]
try {
//your code.
}
catch (Exception $e) {
echo ‘Error!’;
}
finally {
echo ‘Unexpected exception occurs’;
}

[/sourcecode]