If you've ever been able to think of a time or a place that you've said "I really wish I had a goto here!", it might be time for a rewrite or a new job.
Though, admittedly, I don't think I've ever looked at a piece of code I've written that was more than six months old without thinking "who the hell did this and why did they want to torture me?"
Goto is pretty handy if you're not writing in the language but writing a translator to the language instead. That is, when some corporate politics demand the product must be in PHP but you feel you start losing your mind writing in it... well, write in your favorite language and compile it to PHP!
That is by far one of the worst solutions I've heard to the problem. I really feel bad for anyone who is hired to work on your code and told that it was written in PHP, only to look at a compiler generated mess.
If you are raising an error/exception, shouldn't you be doing that explicitly, instead of just outputting catch all error handling at the end of the routine?
Otherwise, we may as well just do: "on error resume next :-)"
This is C, in the kernel. You can't "raise an exception."
The gotos are necessary because kernel work requires allocating resources. If an error is hit, the function needs to exit, but it also needs to release its resources correctly. But, these resources need to be freed upon normal completion as well. Hence, gotos.
Though, admittedly, I don't think I've ever looked at a piece of code I've written that was more than six months old without thinking "who the hell did this and why did they want to torture me?"