Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32850 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58737 invoked by uid 1010); 18 Oct 2007 10:29:43 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 58722 invoked from network); 18 Oct 2007 10:29:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Oct 2007 10:29:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.163 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.163 mail4.netbeat.de Received: from [83.243.58.163] ([83.243.58.163:59422] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/A7-12850-69537174 for ; Thu, 18 Oct 2007 06:29:43 -0400 Received: (qmail 15981 invoked by uid 507); 18 Oct 2007 10:29:37 -0000 Received: from unknown (HELO ?129.187.118.223?) (postmaster%schlueters.de@129.187.118.223) by mail4.netbeat.de with ESMTPA; 18 Oct 2007 10:29:37 -0000 To: Antony Dovgal Cc: Lukas Kahwe Smith , PHP Developers Mailing List In-Reply-To: <47170F2C.3070709@daylessday.org> References: <47170F2C.3070709@daylessday.org> Content-Type: text/plain Date: Thu, 18 Oct 2007 12:29:37 +0200 Message-ID: <1192703377.3026.18.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-4.fc7) Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] exception policy for core From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, On Thu, 2007-10-18 at 11:45 +0400, Antony Dovgal wrote: > On 17.10.2007 20:09, Lukas Kahwe Smith wrote: > > Hi, > > > > I remember that we discussed the question of exception throwing from > > core in the very early days of php 5, when the suggestion of turning > > all errors into exceptions first came up. I remember that we decided > > that exceptions should only be thrown from core on constructor errors > > by default. Along the lines of PDO, extensions could allow users to > > explicitly enable an exception mode. > > First of all, I have to say that I see nothing wrong in using exceptions. > Second, I see nothing wrong in using exceptions _in OO extensions_. > And finally, I don't like the idea of having a special function in each and every extension to control it's error level. > PDO was built this way from the very beginning, but making this some kind of standard would be a mistake IMO. > > You may not like exceptions, but that doesn't make them less useful. The possibility of changing the error mode at run-time makes it quite hard to read code. Since you always have to check the error mode of the object you're currently looking at. Therefore I think we should avoid adding more of these switches in future - especially on an per-object basis. johannes