Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59329 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96352 invoked from network); 2 Apr 2012 20:35:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2012 20:35:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=sam.e.giles@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=sam.e.giles@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.170 as permitted sender) X-PHP-List-Original-Sender: sam.e.giles@gmail.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:46737] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 29/58-43049-B8D0A7F4 for ; Mon, 02 Apr 2012 16:35:24 -0400 Received: by eaao10 with SMTP id o10so855587eaa.29 for ; Mon, 02 Apr 2012 13:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ETOddWbiExIsMuGkcsMmKmxaKrx0IeaNnXcH+ec5fas=; b=DvMEpXRELdvTi4S3dU2lzUBCjTxpsIGmQhre1hwTYMXS7DsmI33ekDcg5pJ92ijGEq rQcvSRDbI9rdOOLKJVSmFyx5MEz6vVMfu+x+3Mpjl0iZU1WGeQBPhE+i+m+Ss/ALzkhU 6URWs6BgjoSbd33MJBBvhRAoSD81PBAf6vQFlnN8N2SPv01inBsAJJUwc8uPMvZLTdiC t4qO3OEwnMDQEdbEfChMiEv7cCh5M/P6xx1UeAe/zkOeO6ib1nPET5mLuOQ3hJrflVYs Bb57ygj1cBuNZJdMsAIUxBJERw2qk7Rzqq8EC/9Q5QPhOpRdzvdBtQLvHanStexrnhP1 19xQ== MIME-Version: 1.0 Received: by 10.14.37.12 with SMTP id x12mr1740263eea.78.1333398920910; Mon, 02 Apr 2012 13:35:20 -0700 (PDT) Received: by 10.213.30.11 with HTTP; Mon, 2 Apr 2012 13:35:20 -0700 (PDT) In-Reply-To: References: Date: Mon, 2 Apr 2012 21:35:20 +0100 Message-ID: To: Rasmus Schultz Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=90e6ba5bbb6506595904bcb821eb Subject: Re: [PHP-DEV] resume after exception From: sam.e.giles@gmail.com (Samuel Giles) --90e6ba5bbb6506595904bcb821eb Content-Type: text/plain; charset=ISO-8859-1 Hi Internals 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! > My major concern would be, how does this* really* add to PHP? Perhaps I'm missing the point, but what would this allow that can't be done in some form using well defined "patterns", for lack of a better word. I'm not keen on the idea of throwing things such as Interrupts either, it doesn't quite fit with their general use case. Sam --90e6ba5bbb6506595904bcb821eb--