Y
Hacker News
new
|
ask
|
show
|
jobs
by
bwaxxlo
3981 days ago
I wanted to actually ask the same thing! I knew of continue but I never encountered such a scenario. It's a poor man's generator.
1 comments
arcatek
3981 days ago
In other languages (such as PHP), the same thing can sometimes be achieved by using "break N" / "continue N", where N is the number of loop you wish to break/continue.
link
mgkimsal
3981 days ago
Specifically in PHP, though, you can't (anymore) break a variable value.
break $n;
isn't valid since PHP 5.4
link