Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62799 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72349 invoked from network); 4 Sep 2012 15:05:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Sep 2012 15:05:48 -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:45100] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/94-46870-BC816405 for ; Tue, 04 Sep 2012 11:05:48 -0400 Received: by yenl2 with SMTP id l2so1212903yen.29 for ; Tue, 04 Sep 2012 08:05:44 -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=ZznBcxTeOTUCud8568/MAI+47qW6dmoXTw0AGMnenhE=; b=1IXudyehU01bDK6mw9iSphvLAjtkfa5ShuDdWujVtQedoRLuBVKrN+zJriQwo4VbyF iJ+S6H9b+3NC3yC6fMRsO5acJWcUD5YXMJIvpCEeg6CIkteVcObypeEsIctz9eT4RTqI xSfcnI2VzkNQNimNVyhzEhmOQR+3bQ0tq90UtUdGTxOznfY7x8QZvA1BIzdP7PNzcB7w lj9nvzDb0ZnPZq/C0JE4YD4CAxV1rLZnrBKqKUFHWBEn9mmzyUwZESUS564O3D0Rs53r EuzOCypJGbxrfDuKWuZ2BpyXbxfj9Mu5ikULwGCF96/IAqvHKLanDDFUhwGAEtWs2N1i TIEg== MIME-Version: 1.0 Received: by 10.52.88.234 with SMTP id bj10mr12884121vdb.48.1346771144433; Tue, 04 Sep 2012 08:05:44 -0700 (PDT) Received: by 10.58.133.229 with HTTP; Tue, 4 Sep 2012 08:05:44 -0700 (PDT) In-Reply-To: <50453FB4.3070606@lerdorf.com> References: <5040DC47.8000305@ajf.me> <5040F4D9.80206@sugarcrm.com> <5042946A.80204@sugarcrm.com> <5042A7D6.7050001@lerdorf.com> <50452713.3020307@sugarcrm.com> <50453FB4.3070606@lerdorf.com> Date: Tue, 4 Sep 2012 17:05:44 +0200 Message-ID: To: Rasmus Lerdorf Cc: Gustavo Lopes , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Re: Are exceptions allowed in php core? From: alex.aulbach@gmail.com (Alex Aulbach) 2012/9/4 Rasmus Lerdorf : > On 09/03/2012 04:31 PM, Alex Aulbach wrote: >> 2012/9/4 Gustavo Lopes : >>>> Following this logic, we'd have to convert all E_NOTICE and E_STRICT to >>>> fatal errors or exceptions - they are usually produced by programming >>>> errors and aren't meant to be caught by surrounding code (actually, >>>> can't). But I don't see anybody benefiting from this - as I don't see >>>> anybody benefiting from generator that will explode your application if >>>> you touch it twice. >> >> Nobody is forced to handle an notice-exception like a fatal exception. >> A notice-exception can be created write something into an error-log >> and tells PHP not to handle it any more (destroys itself). Could be >> all done in the construction of the exception. >> > > First, you got the quoting wrong. Please be more careful with that. Sorry, was written from very old laptop which has problems, when I mark text. > And second, huh? Uncaught exceptions are by definition fatal. There is > no such thing as a notice exception. If we go down that road refer to my > email describing condition error systems. Longer term I think a > condition system would make a lot of sense for PHP, but we definitely > don't want to introduce some sort of bastard non-fatal exception. Maybe I had not the right words to describe, what I mean: I would like to see both worlds (current error-handling and exceptions) in PHP - just as I need it. Your proposal sounds quite interesting. For example: If an SQL-query fails, the query itself isn't normally very interesting (it's wrong, ok). I need to know where it was created and how. The error is not in the database, it's most times in the PHP-program... -- Alex Aulbach