Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62562 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51597 invoked from network); 27 Aug 2012 12:30:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Aug 2012 12:30:04 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:54601] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B9/32-39149-9486B305 for ; Mon, 27 Aug 2012 08:30:03 -0400 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 3D7ADDE13D; Mon, 27 Aug 2012 13:29:58 +0100 (BST) Date: Mon, 27 Aug 2012 13:29:58 +0100 (BST) X-X-Sender: derick@whisky.home.derickrethans.nl To: Ferenc Kovacs cc: PHP Internals , Andrew Faulds , Stan Vass , Etienne Kneuss In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Error handling brainstorming From: derick@php.net (Derick Rethans) On Fri, 3 Aug 2012, Ferenc Kovacs wrote: > Basically Etienne mentioned that the original issue was a good example why > would we reconsider throwing exceptions from the core, which is currently > discouraged.[2] > Stan replied with the idea of turning the current error handling mechanism > in php into using Exceptions for everything, but keeping some error types > as is/uncatchable. [3] This is going to be the biggest BC break *ever*. Instead of harmless notices and warnings that people will and can (and sometimes should) ignore, the moment any of those happens, the script will suddendly because the exception isn't caught. > > Andrew: > From your mails, it seems that you don't agree with Stan on turning > everything but fatals into exceptions[9]. That's a funny one. The only thing that currently makes sense to use an exception for is the E_RECOVERABLE - that is, without potentionally breaking any script that's ever been written. > So basically these are our boundaries: > > - Fatal errors can't be turned into Exceptions, but it was mentioned > multiple times, that there are some fatals, which could be turned into > E_RECOVERABLE_ERROR. Some, but definitely not many. When we introduced E_RECOVERABLE we had a good look at them all. > - Most/all non-fatal errors could be safe to be turned into Exceptions > as without explicit measures(try-catch) on the caller's side, it would > still stop the execution. And hence break the script... cheers, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug