Re: Steal labelled break and continue from zig?
| From: | naitsirch at e dot mail dot de | Date: | Tue, 28 Feb 2023 07:45:12 +0000 |
| Subject: | Re: Steal labelled break and continue from zig? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119611@lists.php.net to get a copy of this message | ||
Am 27-Feb-2023 23:37:29 +0100 schrieb karoly@negyesi.net:
> Hello,
>
> As I was reading
> https://kristoff.it/blog/zig-multi-sequence-for-loops/ I
> found a very nice trick which in PHP would be:
>
> foo: while ($i--) {
> if ($ % 2) break foo;
> }
>
> What do you think?
>
> Charlie
It looks interesting. But we already have goto, which could be used in this case, too.
while ($i--) {
if ($i % 2) goto foo;
}
foo:
Unfortunately goto does not have a good image ;-)
Best regards
Christian