Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62800 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74483 invoked from network); 4 Sep 2012 15:30:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Sep 2012 15:30:43 -0000 Authentication-Results: pb1.pair.com header.from=alex.aulbach@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=alex.aulbach@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: alex.aulbach@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:62752] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/F4-46870-2AE16405 for ; Tue, 04 Sep 2012 11:30:42 -0400 Received: by yenl2 with SMTP id l2so1232329yen.29 for ; Tue, 04 Sep 2012 08:30:39 -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=QHraRhuS4YmGdv/ODTymtfPzLFr9JPnPkdTsbQP17cA=; b=B8084nh29QhJ0zAhIEkXS9XAFijKd5v8CXwk2c0iDu9PR9A16bj++mEz4fztXkjrAF YZGZ1dq5LGcbxdyF7uEy7sEPNyjKRUTLckr6+2ef8MjrwOB2BpaePcFUEq0kKPyT78Tm TCppcB7//PG0f39RIV4cGX/NinWLN4lMCzpQq64Od3Ze4XjmfnL7FiLdsCI0XoJraY6E t5/7ZrL4jX3QG4eqoQgTpaWVnJG9zr7YbiVpMjxWmznt90NA0GC37CC3D3RPVNOX+iIE PYoZDyatC6czRm/4DixKdZfbhKjiYvKUh66l+WoN243CtMcy2KW9myqw31eL+n3TxtUs 1BgA== MIME-Version: 1.0 Received: by 10.58.151.197 with SMTP id us5mr17117015veb.14.1346772639379; Tue, 04 Sep 2012 08:30:39 -0700 (PDT) Received: by 10.58.133.229 with HTTP; Tue, 4 Sep 2012 08:30:39 -0700 (PDT) In-Reply-To: <50444120.40407@lsces.co.uk> References: <50443843.9030004@lerdorf.com> <50444120.40407@lsces.co.uk> Date: Tue, 4 Sep 2012 17:30:39 +0200 Message-ID: To: Lester Caine Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Exceptions Vs Errors From: alex.aulbach@gmail.com (Alex Aulbach) 2012/9/3 Lester Caine : > more ... try/catch always seems like 'I can't be bothered so just do this if > you can' where it would be much tidier if file_put_contents(); was written > so it simply finished with an error if it has a problem? Hm. I want to bring in some thoughts. Perhaps I have not the right words to describe what I mean, but there are 3 things which come in my mind when PHP may switch the error-handling to any kind of exceptions: 1. Current error-handling has it's advantages. Ideal for short programs. I don't wanna miss it. I need to ignore errors completely. 2. I think - prove me wrong :) - it is not possible to change the hole error-handling from one PHP-version to another, especially when the behavior changes so entirely. I think it will take some time. Maybe we have to live with a mixture (new exceptions and old error-handling) for some time? 3. Why not having this as concept? Maybe it's a good strategy to enable both: current error-handling and having exceptions? The rest is logic: When I want to enable to handle an exception like an PHP-error, I need to tell PHP during the creation of the error, that it should not handle it like an exception. Ok, ok, as Rasmus correctly mentioned, uncaught exceptions are by definition fatal. But isn't catching an exception not like "I know how to handle it?" And when I know how to handle it, couldn't I handle it in the exception directly? More questions than answers so far. -- Alex Aulbach