Is GOTO in PHP evil?

Tower picture Tower · Dec 14, 2009 · Viewed 45.7k times · Source

I recently found out that PHP 5.3 supports new language construct called GOTO. Everybody knows what it does. However, it's not exactly the traditional GOTO, it's just a jump label. I'm interesting in knowing whether this GOTO is evil and implies bad code?

Answer

Konamiman picture Konamiman · Dec 14, 2009

Unless you are programming in assembler, GOTO should always be treated the same way as the life vest of the airplanes: it is good to have them available, but if you need to use them it means that you are in big trouble.