Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77793 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29048 invoked from network); 6 Oct 2014 23:07:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Oct 2014 23:07:28 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.75 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.75 smtp75.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.75] ([108.166.43.75:35970] helo=smtp75.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 36/24-30869-EA023345 for ; Mon, 06 Oct 2014 19:07:27 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id BE660180198; Mon, 6 Oct 2014 19:07:23 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp2.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 7677D180178; Mon, 6 Oct 2014 19:07:23 -0400 (EDT) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local ([UNAVAILABLE]. [74.85.23.222]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.2.13); Mon, 06 Oct 2014 23:07:23 GMT Message-ID: <543320AB.4070606@sugarcrm.com> Date: Mon, 06 Oct 2014 16:07:23 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Nikita Popov , PHP internals References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Exceptions in the engine From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > As such I'm re-proposing this RFC for inclusion in PHP 7: > > https://wiki.php.net/rfc/engine_exceptions_for_php7 > > The RFC text is essentially the same as previously, with the primary > difference being that parse errors are now converted to exceptions as well. > This was previously not possible due to limitations in the compiler design. I like this. Fatal errors and warnings were for a long time in different leagues, and the need to handle them better produced E_RECOVERABLE_ERROR which is a weird creature - like exception but not quite. I think PHP 7 is a good time to move to exceptions for real errors (as opposed to informational messages like E_WARNING). The only issue I think we need to discuss is catch(Exception $e). Now it would catch much more than before, if we do no changes. Should we allow it or should be have hierarchy that separates user exceptions and engine exceptions, and have catch(Exception) catch only the former. However, I see in the RFC it does not remove all the errors. I think we need to strive for having all the non-core errors except for out of memory and timeout be converted. Are there ones that are problematic to convert or it is just the question of time/effort? About the long error message - I usually wouldn't recommend that but maybe here is a good place for an ini setting, saying if we really want to display the stack trace for uncaught exceptions? In many production systems, wasting time to collect and then print the backtrace may not be needed, and one-point message is enough. Many tools already have such option (xdebug included) so maybe if we move to exceptions core may have something like that too? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/