Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8990 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53527 invoked by uid 1010); 8 Apr 2004 10:17:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 53501 invoked by uid 1007); 8 Apr 2004 10:17:03 -0000 Message-ID: <20040408101703.53487.qmail@pb1.pair.com> To: internals@lists.php.net Date: Thu, 8 Apr 2004 19:17:05 +0900 Lines: 43 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: Exceptions and builtin functions in PHP5 From: tumurbaatar@datacom.mn ("Tumurbaatar S.") ----- Original Message ----- From: "Tumurbaatar S." Newsgroups: php.general Sent: Thursday, April 08, 2004 17:44 Subject: Re: [PHP] Exceptions and builtin functions in PHP5 > > wrote in message > 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? > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > I bloody hope not or what is the point ? > In the current version of PHP, many built-in functions (if not all?) return FALSE on an error and some resource/handle on a success. So, instead of coding like this: ... $res = some_builtin_func(); // func does not raise exception on error if (!$res) throw new Exception(); // so I throw it manually ... 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?