Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67195 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24588 invoked from network); 29 Apr 2013 16:10:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2013 16:10:39 -0000 Authentication-Results: pb1.pair.com header.from=unreal4u@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=unreal4u@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.179 as permitted sender) X-PHP-List-Original-Sender: unreal4u@gmail.com X-Host-Fingerprint: 209.85.215.179 mail-ea0-f179.google.com Received: from [209.85.215.179] ([209.85.215.179:48487] helo=mail-ea0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BD/30-23191-E7B9E715 for ; Mon, 29 Apr 2013 12:10:39 -0400 Received: by mail-ea0-f179.google.com with SMTP id h10so2632360eaj.10 for ; Mon, 29 Apr 2013 09:10:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:content-type:mime-version:subject:from:in-reply-to:date :cc:content-transfer-encoding:message-id:references:to:x-mailer; bh=PA4/xrJVNo9iwa/NS+cuJWonOrbv2DYtISn0PtkUc+A=; b=ikstOhIfkSVw8SMyjC99Xw26QlEXSXQifab33Yioe8lg/7th8sGjSXFos8sOkvIMCs RE4i3wKQilPmvW1i/wp17+dW2VeSXJP7dU/wWS9hQx5bIlDsnKCt1S4IZT9IfLhJ3woy mXx6qbScB6lj90Grp8uQEjVG7WbRPusLLzxIQks1vtFDMLGF+4poq6OMQicipHIdO28B xUG9rBgmgj5zQp2IBO7fw9zBur7K/lIpkeIvQH6P1y2UB+mDbsg2V0qfh3jYeztxFii6 tj22gopvUczM2mXzmCwE12X1KKtgBaBML/YH1L/U6aN6Vnh9re8okDKj9Bg3FSezwY3p Q6YA== X-Received: by 10.14.182.72 with SMTP id n48mr120763313eem.3.1367219775529; Mon, 29 Apr 2013 00:16:15 -0700 (PDT) Received: from camilo.lan (133-158-ftth.on.nl. [88.159.158.133]) by mx.google.com with ESMTPSA id cd3sm31092601eeb.6.2013.04.29.00.16.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Apr 2013 00:16:14 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) In-Reply-To: Date: Mon, 29 Apr 2013 09:16:08 +0200 Cc: Amaury Bouchard , Ferenc Kovacs , PHP Internals , Patrick Schaaf Content-Transfer-Encoding: quoted-printable Message-ID: <7D1B5825-255D-4DBE-85EB-FAED9A9CF0AB@gmail.com> References: <170891005.EmXIrsICLC@rofl> To: Julien Pauli X-Mailer: Apple Mail (2.1503) Subject: Re: [PHP-DEV] Continued try blocks From: unreal4u@gmail.com (Camilo Sperberg) On Apr 28, 2013, at 17:27, Julien Pauli wrote: > On Sat, Apr 27, 2013 at 3:56 PM, Amaury Bouchard = wrote: >=20 >> 2013/4/27 Ferenc Kovacs >>=20 >>> please don't reuse the continue keyword for it. >>>=20 >>> There are a bunch of code out there where which uses exceptions in a = loop >>> context. >>> For example you have a retry counter decremented in a loop and you = catch >>> the exceptions and retry until the retry limit is reached. >>>=20 >> Fair enough. We can use "resume". >>=20 >=20 > "continue" is just a keyword (syntactic sugar) we sure can change, I = like > "resume" yes :-) >=20 > Julien.Pauli And how about a restart instead of resume? I have used try catch blocks = as a type of transactional block, so I think it would be nice if I could = restart the entire block instead of resuming from the last point where = it failed: $blue =3D 'blue'; try { $data =3D a($blue); b($data); // This throws the dataIntegrityException c(); } catch (dataIntegrityException $e) { $blue =3D 'is the new red'; restart; // executes a(), b() and c() again } catch (Exception $e) { rollback(); } Greetings.=