Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67196 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26143 invoked from network); 29 Apr 2013 16:17:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2013 16:17:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=unreal4u@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=unreal4u@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.45 as permitted sender) X-PHP-List-Original-Sender: unreal4u@gmail.com X-Host-Fingerprint: 74.125.83.45 mail-ee0-f45.google.com Received: from [74.125.83.45] ([74.125.83.45:48792] helo=mail-ee0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/90-23191-DFC9E715 for ; Mon, 29 Apr 2013 12:17:02 -0400 Received: by mail-ee0-f45.google.com with SMTP id l10so2667985eei.4 for ; Mon, 29 Apr 2013 09:16:59 -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:message-id:references:to:x-mailer; bh=OhETeMAy4Ggxv+5aOcxl/mbC+zb5qnSb5rxV4TTzk9w=; b=PUDsdnRJu1RjIzgYtO/zMF5/SGgAUzjBUIaO4zTAh1KGCTqvwYZ4S5z48Xu53sUpJT aJGj6Jm0ko+AcoX2a9qvuOOOZQOvwjCIbA98HRdERRSz67kl6grgZ5iu6pWx1RbF7S3W QqA42rzGurFTu01D7BV52sbYScS9Pw+LofooFUfbZx2pGwPyDpwGi9MUAaMluT8s+bZ3 zygWs1yjGn+vAV0aU12rRVxnByzu1HmYeGAg0bBGb3mKO5Kev1PmXrvY4nFRPi6+Ff3L TnKr6bzlBQnibUZrh0thitZdSBFFLJ/e87Ct5s1EB9xrX5KRqKXXAQsrW0MbikYkhYF9 iGKQ== X-Received: by 10.15.52.70 with SMTP id o46mr75774924eew.14.1367220967182; Mon, 29 Apr 2013 00:36:07 -0700 (PDT) Received: from camilo.lan (133-158-ftth.on.nl. [88.159.158.133]) by mx.google.com with ESMTPSA id f9sm31130375eeu.11.2013.04.29.00.36.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Apr 2013 00:36:06 -0700 (PDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_35A84408-4A16-4583-B3BD-7742D79DC4FD" Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) In-Reply-To: Date: Mon, 29 Apr 2013 09:36:00 +0200 Cc: Julien Pauli , Ferenc Kovacs , PHP Internals , Patrick Schaaf Message-ID: <52551B68-E7D1-42EB-93C9-27E593367B9D@gmail.com> References: <170891005.EmXIrsICLC@rofl> <7D1B5825-255D-4DBE-85EB-FAED9A9CF0AB@gmail.com> To: Amaury Bouchard X-Mailer: Apple Mail (2.1503) Subject: Re: [PHP-DEV] Continued try blocks From: unreal4u@gmail.com (Camilo Sperberg) --Apple-Mail=_35A84408-4A16-4583-B3BD-7742D79DC4FD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On Apr 29, 2013, at 09:25, Amaury Bouchard wrote: > Why not. But it will come in addition to "resume", not instead of it. > Then: > - "resume" =3D> continue execution just after the point where the = exception was raised. > - "restart" =3D> restart the whole try block. >=20 > I don't understand the meaning of your "rollback". >=20 >=20 > 2013/4/29 Camilo Sperberg >=20 > On Apr 28, 2013, at 17:27, Julien Pauli wrote: >=20 > > On Sat, Apr 27, 2013 at 3:56 PM, Amaury Bouchard = wrote: > > > >> 2013/4/27 Ferenc Kovacs > >> > >>> please don't reuse the continue keyword for it. > >>> > >>> 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. > >>> > >> Fair enough. We can use "resume". > >> > > > > "continue" is just a keyword (syntactic sugar) we sure can change, I = like > > "resume" yes :-) > > > > Julien.Pauli >=20 > 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: >=20 > $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(); > } >=20 > Greetings. >=20 It was just to denote the nature of a transaction block, nothing = important ;) --Apple-Mail=_35A84408-4A16-4583-B3BD-7742D79DC4FD--