Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67182 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83990 invoked from network); 27 Apr 2013 14:27:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Apr 2013 14:27:02 -0000 Authentication-Results: pb1.pair.com header.from=admacedo@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=admacedo@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.177 as permitted sender) X-PHP-List-Original-Sender: admacedo@gmail.com X-Host-Fingerprint: 209.85.223.177 mail-ie0-f177.google.com Received: from [209.85.223.177] ([209.85.223.177:47485] helo=mail-ie0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/D1-08285-630EB715 for ; Sat, 27 Apr 2013 10:27:02 -0400 Received: by mail-ie0-f177.google.com with SMTP id 9so5756799iec.8 for ; Sat, 27 Apr 2013 07:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=lqCmpy033dBWIb/GpDe1qkd+Cwjm3lZFLE96y8m5zT8=; b=S0CsLup+nIRe2aTBxsDCygXLodYrwMrGwT1NYlwbLbDeMjY+c+ABxMwu2AmK1omuEd /9WmELbtatgMhR62w6q2X2KwqoO0MAcIJRZZG3pvt8KuoaZZZOOEtoMSEvI/JZ20+WrU h88zqtWR4E9lCd7vGEvs3Jo7s06fuie1bc0YR5U2+f384mcQMgAghie08nqJ/myU7ky7 UhopYvtlZoO45qrqjcWCH7rthh0W0ICNQ/g3Q3MQlAWYBD15l7qca4pRvBByTJTS1FDK kVa36s6PmfCNJuzoOpJZXNwaMb6jko0RdoD3ftcim7c29joVHQH04UEedwzZdsMiK8Jj s5jQ== X-Received: by 10.50.11.229 with SMTP id t5mr4129765igb.65.1367072819736; Sat, 27 Apr 2013 07:26:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.51.168 with HTTP; Sat, 27 Apr 2013 07:26:19 -0700 (PDT) In-Reply-To: References: <170891005.EmXIrsICLC@rofl> Date: Sat, 27 Apr 2013 15:26:19 +0100 Message-ID: To: Amaury Bouchard Cc: Ferenc Kovacs , Julien Pauli , PHP Internals , Patrick Schaaf Content-Type: multipart/alternative; boundary=e89a8f646d15cda89504db5871d2 Subject: Re: [PHP-DEV] Continued try blocks From: admacedo@gmail.com (Daniel Macedo) --e89a8f646d15cda89504db5871d2 Content-Type: text/plain; charset=ISO-8859-1 Sorry but I disagree, I think you're approaching try-catch wrong. You shouldn't have a try-catch that *can* continue on the next line after the throw. What you should do is have decoupled code that handles _their own exceptions_ nicely and either cleans up after itself else it rethrows the exception/a new one. Any top level try-catch is supposed to be a control structure with one of two chances: either lines 1-N go smoothly and no exceptions are thrown, or Exception_X is thrown and you clean up on it's catch block... Also remember that you have the finally block. --e89a8f646d15cda89504db5871d2--