Re: resume after exception

From: Date: Mon, 02 Apr 2012 20:35:20 +0000
Subject: Re: resume after exception
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-59329@lists.php.net to get a copy of this message
Hi Internals function test() > { > echo "Begin Test!\n"; > > throw new Interrupt(); > > echo "Execution resumed!"; > } > > try > { > test(); > } > catch (Interrupt $e) > { > echo "Execution interrupted.\n"; > resume; > } > > The output of this would be: > > Begin Test! > Execution interrupted. > Execution resumed! > My major concern would be, how does this* really* add to PHP? Perhaps I'm missing the point, but what would this allow that can't be done in some form using well defined "patterns", for lack of a better word. I'm not keen on the idea of throwing things such as Interrupts either, it doesn't quite fit with their general use case. Sam

« previous php.internals (#59329) next »