I'm available to work on new projects starting July 2020! Get in touch!

Back to post list

Finally, file streams, and deferred execution in PHP

02-06-2016

Frank De Jonge explains how the finally statement can be used in PHP. finally was added in PHP 5.5, but isn't used a lot. This is the first time I see a real interesting use-case for it.

In PHP we can handle exceptions using try/catch blocks. In PHP 5.5 the finally block was added to this group. This group is executed regardless of which catch block handles a given exception.

Read the full article

I'm available to work on new projects starting July 2020! Get in touch!

Why Care About PHP Middleware? How to apply a feature to another branch in git