Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67490 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32684 invoked from network); 24 May 2013 14:36:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2013 14:36:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.171 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.214.171 mail-ob0-f171.google.com Received: from [209.85.214.171] ([209.85.214.171:58067] helo=mail-ob0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/98-20943-70B7F915 for ; Fri, 24 May 2013 10:36:56 -0400 Received: by mail-ob0-f171.google.com with SMTP id ef5so5542485obb.2 for ; Fri, 24 May 2013 07:36:53 -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=iN1qPQrUcO28AH0UoEI4p9fteBFKdBuB7lEkvioRsJw=; b=xDTdb9j1Aj3WiBH2AEqgDd32CMxwNlJLwbhBmzF/4ZgcfHPcZW6fM0JV7hk3apIPCN nWgVzxjVDxj0Mn7WTp+MviMZu6nU3U9Xr2nv0SFk7nZl/oJCbsv+rNGBa56zTwowySiy t6oJTzGBCRUaX8lnsfnFoVLZKBwjRTcwOcMT/bCiglbI9ynZA2xbwH+q5sloCDayaNQF 7PA/W5dvMeQX1gHVPfyaiRBRG8jQd11/Kbrx5OcEuZQyUHKIKdds32QC5avqsxYwIejM IRPIlTYYld2rAh3N+RE3hp4GFNVVmVR/2J7ZQHfPB1njD+Y2BtqBSbhA30FElLC2xmSx TLkA== MIME-Version: 1.0 X-Received: by 10.60.134.71 with SMTP id pi7mr12001058oeb.107.1369406212980; Fri, 24 May 2013 07:36:52 -0700 (PDT) Received: by 10.76.150.193 with HTTP; Fri, 24 May 2013 07:36:52 -0700 (PDT) In-Reply-To: <519F2852.7040601@sugarcrm.com> References: <519E797D.7040405@php.net> <519E7A88.5070208@sugarcrm.com> <519F2852.7040601@sugarcrm.com> Date: Fri, 24 May 2013 08:36:52 -0600 Message-ID: To: Stas Malyshev Cc: Josh Davis , "internals@lists.php.net" , Sebastian Bergmann Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Bug #64910: Line number of $e = new Exception vs. line number of throw $e From: morrison.levi@gmail.com (Levi Morrison) > Also, throwing new exception with previous is not the same as throwing > the same exception twice. Correct, but I've personally never thrown the same exception twice. The only times I've thrown exceptions from catch blocks is to provide a better exception or perhaps to abstract away something in the implementation. For instance, if I hit a PDO exception in my data access then I'll catch it somewhere higher in the structure and throw a GatewayException instead. Likewise, if the data was coming from The Cloud and I couldn't access it for some reason I'd throw the GatewayException. This way when someone uses the gateway the implementation doesn't leak. This is the only time I've thrown exceptions in a catch block. This is an interesting 'bug' or 'feature' or whatever you want to call it. I wouldn't say the current way is wrong, but a naive approach would have some interesting issues as well. More than anything I think we just need to decide what we want the behavior to be a document the resulting quirks.