go to bug id or search bugs for
PHP 5.3 includes goto. This is a problem. Seriously, PHP has made it this far without goto, why turn the language into a public menace?
The world will end.
The world ended.
Add a Patch
Add a Pull Request
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
It makes php more buggy and suitable only for small programs. Is there anybody out there like readable code.
sounds like a valid bug to me ;)
Seriously, goto is awesome and in some cases,
very useful and can make the code a lot more clean.
Are bad/unexperienced programmers use 'goto' to create some crazy ugly mess?
I have no doubt about it, but that doesn't mean that the feature
itself is the problem. The problem is the programmer's inexperience,
and it is not the place of the language to teach the programmer
better programming practices.
Goto is great, for example, for cleanups. You put some cleanup
code in the end of a function and in its body you check for
several test cases where things could go wrong. If something goes
wrong, you signal the error and jump directly to the cleanup
with 'goto', instead of having to create a big mess of if's to
test if an error has happened or not on each step, to then decide
whether your function should continue executing or not.
It is a primitive in pretty much any architecture
(cmp, jmp/jz, etc) and used extensively in the linux kernel,
Anyone who complains about goto being 'dangerous' is either
a blind fad follower or just believes that the language should
master the programmer (and not the other way around).
Why would you need GOTO for bug handling? We have a wonderful Exception system.
It can do everything you want.
I don't see anything wrong with using "goto" the php manual says:
"...The target label must be within the same file and context..."
Surely if a programmer manages to mess up the use of this, he/she must be a complete nit·wit...
I can't recommend anyone to mess up their code with a million goto's but, it may be useful.
if you don't want to take on the task of determining how, when and when not, to make use of certain aspects of a language, it really is your own loss...
You are then, beyond help.