Finally

Finally is the default clause of a try-catch expression. It is run after all the catch clauses have been called.

Finally is run every time after a try, with or without any catch clause. It is also run before the return expression, if any.

<?php

    try {
        doSomething();
    } catch (\Exception $e) {
        print "An exception was raised and caught";
    } finally {
        print "Finally\n";
    }

?>

Documentation

See also How to use Try - Catch - Finally in PHP.

Related : Try-catch, Catch, Exit, Resource Leak

Added in PHP 7.0