Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67497 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46721 invoked from network); 24 May 2013 15:44:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2013 15:44:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.48 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.216.48 mail-qa0-f48.google.com Received: from [209.85.216.48] ([209.85.216.48:58091] helo=mail-qa0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/AB-20943-ECA8F915 for ; Fri, 24 May 2013 11:44:15 -0400 Received: by mail-qa0-f48.google.com with SMTP id o13so2352669qaj.0 for ; Fri, 24 May 2013 08:44:11 -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:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=SMzZdbIjsssO5vSDsdxiauZwl4XeKsHH5fgakqfYYyI=; b=XKsC2VQN6NPEBUhxmsulGwn3tOZbfUw/+jsAY/upQlFrouILOb5c9YaArQ+fhpvp5h n//z7jgx2uIFrJIIRSc55LioWprb/1QVSgN0cyQmdKzCb7kMsnlgnMmK7QJ6klkiKn+7 bh27TvSmV1MVhwULi/xoPAiF/zA9s7ksfhPY40O0dk3TAGjoFcpeDwFtOr+9GaX0T+U7 +i9N2v5aOkFPGYyCmo3LPg1PAVcoKrZLHOzJrNL+qp9cqxoj3OALsW8LhrXcLd7ma795 qrGyknlsW48Wvi7ge0cU/GVJmof3OY2ByWkVq6lXNeBrx6dey7+jiM6XDNtVUtbueCS4 NsyQ== X-Received: by 10.49.117.37 with SMTP id kb5mr19099732qeb.26.1369410251663; Fri, 24 May 2013 08:44:11 -0700 (PDT) MIME-Version: 1.0 Sender: ekneuss@gmail.com Received: by 10.49.120.234 with HTTP; Fri, 24 May 2013 08:43:50 -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 17:43:50 +0200 X-Google-Sender-Auth: lW3KjAMmRB3KcQ2sp-OkIS3R90s Message-ID: To: Stas Malyshev Cc: Josh Davis , "internals@lists.php.net" , Sebastian Bergmann Content-Type: multipart/alternative; boundary=047d7b6789609a30bf04dd78ab83 Subject: Re: [PHP-DEV] Bug #64910: Line number of $e = new Exception vs. line number of throw $e From: colder@php.net (Etienne Kneuss) --047d7b6789609a30bf04dd78ab83 Content-Type: text/plain; charset=UTF-8 On Fri, May 24, 2013 at 10:44 AM, Stas Malyshev wrote: > Hi! > > > As a PHP programmer, I would always expect the file/line to refer to > > the throw statement that has thrown it last. If I wanted to keep track > > It is rather surprising that you would expect that as a PHP programmer, > since it never worked this way in PHP, and no PHP code works this way > either. > > Also, throwing new exception with previous is not the same as throwing > the same exception twice. I agree, I think it makes sense to see exceptions as immutable and let "new" define the line. If you want to rethrow an exception in a different context while keeping track of both, I think chaining them is the better approach: throw new AnotherException("..", 0, $thepreviousexception); > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Etienne Kneuss http://www.colder.ch --047d7b6789609a30bf04dd78ab83--