Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8993 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22494 invoked by uid 1010); 8 Apr 2004 11:06:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 22468 invoked by uid 1007); 8 Apr 2004 11:06:50 -0000 Message-ID: <20040408110650.22388.qmail@pb1.pair.com> To: internals@lists.php.net References: <20040408101703.53487.qmail@pb1.pair.com> Date: Thu, 8 Apr 2004 20:06:51 +0900 Lines: 51 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Posted-By: 202.131.3.241 Subject: Re: [PHP-DEV] Exceptions and builtin functions in PHP5 From: tumurbaatar@datacom.mn ("Tumurbaatar S.") "Derick Rethans" wrote in message news:Pine.LNX.4.58.0404081244590.9058@localhost... > On Thu, 8 Apr 2004, Tumurbaatar S. wrote: > > > > news:49201.203.15.102.65.1081404627.squirrel@www.electroteque.org... > > > > > If I understand right, PHP5 has an exception > > > > > handling mechanism but it is only for "manual" using, i.e. > > > > > a programmer can use try/catch but only for own code. > > > > > PHP's built-in functions and functions from extensions still > > > > > use old "return value" method. Yes? > > > > > > > > I bloody hope not or what is the point ? > > > > > I want to write: > > ... > > $res = some_builtin_func(); // func raises exception on error > > // so I don't need to write additional lines > > ... > > > > So will PHP5 (or future versions) work as in my 2nd example? > > No > > regards, > Derick "Zend Engine. Version 2. Feature Overview and Design." PDF says that: ... Compatibility notes No compatibility problems exist, as this feature doesn't exist in previous versions of the scripting engine. In order to simplify error handling in the existing code base, the engine will support a mode in which errors (such as E_WARNING and E_NOTICE) will raise exceptions, instead of displaying an error. This will allow users to use one try..catch statement to recover from any possible errors during the course of a large code block (e.g., establishing a connection to a database server, selecting a database, and issuing a query), without having to add lots of error-handling code. ... Is it not what I'm talking about?