On Mon, 6 Jun 2005, Stanislav Malyshev wrote:

> DR>>We're only talking about a goto that:
> DR>>- can only jump to a static label
> DR>>- can only jump inside the current scope
> DR>>
> DR>>With a parameterized break/continue you still can't just to the "end" of 
> DR>>your function to do clean ups (unless you wrap it in a control block 
> 
> finally construct should do that, I think. IMO that's the right solution, 
> not goto's - and anyway if you allow goto only inside same block, what if 
> error condition happens inside other block? Are all your functions flat 
> without control blocks? What if exception happens - are you not going to 
> clean up then? 

exceptions and goto don't mix in the first place. goto can be used to 
emulate exceptions in non-OO code.

> Using control blocks is no more ugly than using goto's - and thr right way 
> to do it is using exception handling and finally, IMO. 

IMO exceptions make more possibilities for spagetti code as you can use 
them to bubble out of the current scope. Also, exceptions are a no-no in 
procedural code.

Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to