Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60909 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6021 invoked from network); 21 Jun 2012 03:17:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jun 2012 03:17:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gh0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:55272] helo=mail-gh0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/70-01913-34292EF4 for ; Wed, 20 Jun 2012 23:17:24 -0400 Received: by ghbg2 with SMTP id g2so142888ghb.29 for ; Wed, 20 Jun 2012 20:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3zwFw5ddJDIr2d8BjLspq6RsZVBB7fttRqoLsxmuuNI=; b=FHKXQxjOPyXtnzzI0Cf1ocBbyELufdiWApDkdDCX9qkyKz3w2nwpVqFhw3etuqZRvl z/7Ex0BZdHMUKUUijZnDOOJwMltuAp+AtF7SBkDal+MrEJm7efErdi8beWScGrRCk7Bj W1HF48PYO/jB3iOhyko2mSR/B7QOFdQlEkstSswxgUQMYtRB/rf4qd/lNkcJ6H/r4W2N GZsO0Z+2j9l54lYlceZOJiiy3l3zzXTgYeFY2xn0tHeOMLsB5rVSxe46NY4ol68b3Ttl 10UEqn3ChK7C62KH5sJr+XSCvK918CeGUwFR8/9vnjz4yTTPXrEnlgG+uOVQZmCMG794 5fZA== MIME-Version: 1.0 Received: by 10.236.176.129 with SMTP id b1mr3360753yhm.126.1340248641439; Wed, 20 Jun 2012 20:17:21 -0700 (PDT) Sender: tjerk.meesters@gmail.com Received: by 10.146.197.4 with HTTP; Wed, 20 Jun 2012 20:17:21 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 Jun 2012 11:17:21 +0800 X-Google-Sender-Auth: cilDGfh9JgdP4LdIktKVte4yY_A Message-ID: To: Michael Morris Cc: PHP Internals List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Resume keyword From: datibbaw@php.net (Tjerk Anne Meesters) > Resume is similar to return, but can only be used in catch blocks or > in error handling functions. =A0When encountered the run time returns to > the line after the exception was initially thrown and, well, > "resumes". Interesting idea. Just by reading that I thought of this scenario instead: --------------- try { echo "about to throw exception"; throw new Exception; echo "still alive"; } catch (Exception $e) { resume; } ------------- Which kinda looks nice to have. But how about this: -------------- function my_function() { echo "throwing exception"; throw new Exception; echo "still here?"; } try { echo "calling function"; my_function(); } catch (Exception $e) { resume; } ---------------- By the time the exception is handled, the function stack would have been unloaded, so how would it be able to resume? :) > > If resume has a value, and the exception was an assignment operation, > then that value is assigned to the variable. This feels a bit too magical IMO