Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72655 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42300 invoked from network); 17 Feb 2014 10:43:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2014 10:43:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:51323] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/9E-56374-9C7E1035 for ; Mon, 17 Feb 2014 05:43:21 -0500 Received: from [192.168.2.31] (ppp-93-104-26-120.dynamic.mnet-online.de [93.104.26.120]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id EC1403FE8D; Mon, 17 Feb 2014 11:43:58 +0100 (CET) To: Lester Caine Cc: PHP internals In-Reply-To: <5301D6FD.3070607@lsces.co.uk> References: <5301C3A2.3060506@sugarcrm.com> <5301CB23.2090305@lsces.co.uk> <5301D6FD.3070607@lsces.co.uk> Content-Type: text/plain; charset="UTF-8" Date: Mon, 17 Feb 2014 11:43:16 +0100 Message-ID: <1392633796.3990.218.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] my take on PHP 6, part 2 From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Mon, 2014-02-17 at 09:31 +0000, Lester Caine wrote: > While the discussion has also been opened up to include C++ which use > 'exceptions' in normal process flow, IS it a given that we have to have > exceptions at all? To my mind proper error handling should prevent the 'white > screen' as the only way of handing things when everything has gone tits up? :( Yes, we need Exceptions as Exceptions are the only good way to report recoverable errors from constructors. The reason C++ libraries like ICU allow disabling exceptions (if that's the case, haven't researched) is that many projects disable exceptions while compiling. Reason for that are a) longterm users don't trust the compiler to create as efficient code (fact is the code generated by modern C++ compilers typically is more efficient than code with "classic" error handling, which includes more branches) b) Writing exception safe code in C++ isn't easy. Proper use of smart pointers and RAII makes this viable. But many legacy libraries don't follow those patterns. Contrary to PHP there is no native ref counting / GC in C++ so non-exception-safe code leads to resource leaks. Both things aren't that kind of issues in PHP. Preventing a white page for exceptions can be done with a error handler catching unhandled exceptions. johannes