Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59343 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76976 invoked from network); 3 Apr 2012 09:53:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Apr 2012 09:53:39 -0000 Authentication-Results: pb1.pair.com header.from=kiall@managedit.ie; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kiall@managedit.ie; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain managedit.ie designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: kiall@managedit.ie X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:47122] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 10/83-54877-1A8CA7F4 for ; Tue, 03 Apr 2012 05:53:38 -0400 Received: by vcbfo14 with SMTP id fo14so2590861vcb.29 for ; Tue, 03 Apr 2012 02:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=managedit.ie; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=00yUw0UQjtfqxCVkaxJGvTBgMxt7QA8+AXA0kbwjGAM=; b=SzCc4SU4l8Ia7m0gG4A/eues54E2oJ+NwtwPoTYt35Hzz7xe5lq5u1reXbQsIPpB2v bOOhT1CKe5YTqVLRVLduM60Cj/ZIXS3vaxJ9Tv+jGYkdh4oaEcmx6YiphM86oLZcPAG/ q7CdzYP0yvexUeuqRGNf/U/x1Q8wCy7soeAKQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=00yUw0UQjtfqxCVkaxJGvTBgMxt7QA8+AXA0kbwjGAM=; b=pGsXDcQWs6m+sthlOJnu7t6JW3KuihSfHBdRWW8Ua2z3XF5T15OGlFjed+75wOzky4 ZwsJ7uohh1cMX4QnR1eyMeejY1RTBgfOz84VhHI+0MhcBTwRXLgARgeeYsK2Kd0F3Ltp bDhuTckLwZ0Swl4XyvSUxy0qm9NqAJI6GHuAgU0Wtu2Q51R3TdDdllwHlwes/Omu6h+M +OXklsKtaULKgrN1zTTrCh9OpdsQC8ccgKXMDIpt9Ja54047xmYjA/by8kzPRuqWSbMq jZUiLocP95CFrpSzHWry5PZyB28mDHEK/Lwx0LJHE6420r+xpg7ezVlAZkXbznpSjBxa EaGg== MIME-Version: 1.0 Received: by 10.52.180.7 with SMTP id dk7mr4789343vdc.25.1333446814438; Tue, 03 Apr 2012 02:53:34 -0700 (PDT) Received: by 10.220.210.18 with HTTP; Tue, 3 Apr 2012 02:53:33 -0700 (PDT) Received: by 10.220.210.18 with HTTP; Tue, 3 Apr 2012 02:53:33 -0700 (PDT) In-Reply-To: <2FD77C3003DC4656BCF6309B097DD978@gmail.com> References: <2FD77C3003DC4656BCF6309B097DD978@gmail.com> Date: Tue, 3 Apr 2012 10:53:33 +0100 Message-ID: To: reeze Cc: internals@lists.php.net, Rasmus Schultz Content-Type: multipart/alternative; boundary=bcaec5196509b3943004bcc3471a X-Gm-Message-State: ALoCoQlVWufKFsVBX3/Kny2rCsA0js5lHz0dusPFOObUfjr/joKvnEdjT1/QYKiQ4y87sU9D7Ur+ Subject: =?UTF-8?B?UmU6IFtQSFAtREVWXSDlm57lpI3vvJogW1BIUC1ERVZdIHJlc3VtZSBhZnRlciBleGNlcA==?= =?UTF-8?B?dGlvbg==?= From: kiall@managedit.ie (Kiall Mac Innes) --bcaec5196509b3943004bcc3471a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Retry is a feature I would very much like to see... While it's not stritcly necessary to implement in core, it makes the code much cleaner.. Thanks, Kiall Sent from my phone. On Apr 3, 2012 8:28 a.m., "reeze" wrote: > If just for exception recovery how about implement ruby's retry ? > > http://www.tutorialspoint.com/ruby/ruby_loops.htm Ruby retry statement > section. > > > > =E5=9C=A8 2012=E5=B9=B44=E6=9C=882=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=80=EF= =BC=8C=E4=B8=8B=E5=8D=888:44=EF=BC=8CRasmus Schultz =E5=86=99=E9=81=93=EF= =BC=9A > > > I was just reading about the new async/await keywords in C# 5.0, and > while > > this has no particular relevance to PHP as such, it got me thinking abo= ut > > this idea... > > > > What if you could resume execution after an exception was thrown? > > > > Fictive example: > > > > function test() > > { > > echo "Begin Test!\n"; > > > > throw new Interrupt(); > > > > echo "Execution resumed!"; > > } > > > > try > > { > > test(); > > } > > catch (Interrupt $e) > > { > > echo "Execution interrupted.\n"; > > resume; > > } > > > > The output of this would be: > > > > Begin Test! > > Execution interrupted. > > Execution resumed! > > > > In other words, Interrupt is a new type of Exception, from which you ca= n > > recover, using the new resume keyword. > > > > Taking this one step further, imagine it were also possible to > serialize() > > an Interrupt - and resume it at a later time. This would open up entire= ly > > new possibilities for (AJAX) web-application frameworks, which would be > > able to suspend execution, serialize the script state, return a respons= e, > > wait for further interaction from the user, and then resume execution. > > > > I'm sure there are lots of problems with this idea, and perhaps it's no= t > a > > good fit for PHP at all, but I figured it couldn't harm to put the idea > out > > there anyway :-) > > > > Any thoughts? > > --bcaec5196509b3943004bcc3471a--