Sorry ... to the list instead. ---------- Forwarded message ---------- From: Sebastian Krebs <krebs....@gmail.com> Date: 2012/7/24 Subject: Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions To: Laruence <larue...@php.net>
Hi, 2012/7/24 Laruence <larue...@php.net> > On Tue, Jul 24, 2012 at 7:41 PM, Alexey Zakhlestin <indey...@gmail.com> > wrote: > > > > On 24.07.2012, at 15:20, Laruence wrote: > > > >> Hi: > >> As the previous threads disscussed, I make a implemention. > >> > >> here is the RFC: https://wiki.php.net/rfc/finally > >> > >> any suggestions? > > > > Will it work without "catch" in your implementation? > nope for now. > > but if it is needed, I can implemente it > It is. 'catch()' usually means "I can handle it (at least partially)", but when 'finally' it just means, that the current scop wants to clean up ;) Additional I see myself already, that I "misuse" it like $f = fopen($file, 'r+b'); try { return search_in_file($f); } finally { fclose($f); } What I mean: I see myself already using 'finally' without ever expecting an exception, just because it feels so easy to never forget anymore to cleanup resources. Is this intentionally? Regards, Sebastian > > thanks > > > > try { > > doSomethingDangerous(); > > } finally { > > doCleanup(); > > } > > > > -- > Laruence Xinchen Hui > http://www.laruence.com/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >