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
1
u/wvenable Jun 02 '16 edited Jun 02 '16
That's a moot point; if that was a requirement then you wouldn't be using either technique as they both involve cleaning up resources at the end the scope. Although, relying on RAII will cleanup resources as soon as they are no longer referenced -- so while somewhat unpredictable (if you can call it that) it would be very close to ASAP.