Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99548 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83789 invoked from network); 19 Jun 2017 14:28:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jun 2017 14:28:50 -0000 Authentication-Results: pb1.pair.com header.from=lists@rhsoft.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=lists@rhsoft.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain rhsoft.net designates 91.118.73.15 as permitted sender) X-PHP-List-Original-Sender: lists@rhsoft.net X-Host-Fingerprint: 91.118.73.15 mail.thelounge.net Received: from [91.118.73.15] ([91.118.73.15:49985] helo=mail.thelounge.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/F6-13828-1AFD7495 for ; Mon, 19 Jun 2017 10:28:49 -0400 Received: from srv-rhsoft.rhsoft.net (Authenticated sender: h.reindl@thelounge.net) by mail.thelounge.net (THELOUNGE MTA) with ESMTPSA id 3wrtd96y1VzXMk for ; Mon, 19 Jun 2017 16:28:45 +0200 (CEST) To: internals@lists.php.net References: Message-ID: <21f496b6-2af5-76e0-d8ca-9d49ab793258@rhsoft.net> Date: Mon, 19 Jun 2017 16:28:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-CH Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] [Discussion] Retry functionality From: lists@rhsoft.net ("lists@rhsoft.net") Am 19.06.2017 um 16:24 schrieb Ivan Enderlin: > Thank you for the RFC. I have a question though. I would like to know > how is it different from the `goto` language construction? > > If I understand it correctly, both the following examples are identical: > > try { > > // … > > } catch (…) { > > retry; > > } > > and: > > try { > > retry: > > // … > > } catch (…) { > > goto retry; > > } even if both works the retry-statement is much clearer, especially when the code becomes larger than these few lines > Also, what happens if the `try` block keeps failing over and over again: > This is a non-breakable loop. well, as for other loops you are responsible at your own to count up a $retry_count and stop after N tries