glenelkins Posted November 16, 2006 Share Posted November 16, 2006 HiIf for example we had a loop[code]for ($i=0;$i<10;$i++) { if (condition is false) { break; }}[/code]Is there a way to make this code Break to a label/tag in the code? Link to comment https://forums.phpfreaks.com/topic/27439-lack-of-gotobreak-to-a-label/ Share on other sites More sharing options...
printf Posted November 16, 2006 Share Posted November 16, 2006 I don't understand what you mean by [b]label/tag[/b], please explain it in more detail. As for jumping to some other place in the script like [b]evil[/b] GOTO, it's not going to happen until PHP 6, even then it will be limited, because using GOTO, equates to bad coding logic, no matter how useful you think it might be.Dennis Ritchie[b]goto[/b] is usually used as an advanced tool, but is never needed in well designed algorithms. Link to comment https://forums.phpfreaks.com/topic/27439-lack-of-gotobreak-to-a-label/#findComment-125497 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.