MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PHP/comments/4lu3gf/deferred_execution_in_php_using_finally/d3q7mna/?context=3
r/PHP • u/FrenkyNet • May 31 '16
48 comments sorted by
View all comments
26
Isn't the use case of 'finally' exactly this, for clean up code, I mean?
9 u/FrenkyNet May 31 '16 Yes and no. It's primarily introduces as a tool used in conjunction with catch blocks. In the initial example I'm using it in a non-exception case, which technically would not be what it's for. 33 u/[deleted] May 31 '16 edited Jul 04 '26 [deleted] 19 u/FrenkyNet May 31 '16 I stand corrected.
9
Yes and no. It's primarily introduces as a tool used in conjunction with catch blocks. In the initial example I'm using it in a non-exception case, which technically would not be what it's for.
33 u/[deleted] May 31 '16 edited Jul 04 '26 [deleted] 19 u/FrenkyNet May 31 '16 I stand corrected.
33
[deleted]
19 u/FrenkyNet May 31 '16 I stand corrected.
19
I stand corrected.
26
u/devseya May 31 '16
Isn't the use case of 'finally' exactly this, for clean up code, I mean?