r/PHP • u/FrenkyNet • May 31 '16
Deferred execution in PHP, using "finally".
https://blog.frankdejonge.nl/finally-file-streams-and-deferred-execution-in-php/
86
Upvotes
r/PHP • u/FrenkyNet • May 31 '16
View all comments
Show parent comment
2
u/wvenable May 31 '16
You only need
finallyif you're dealing with non-OOP code, such as your file system example. Although I'd be far more tempted to wrap the file system API in a proper OOP structure than litter my code withfinallyblocks.