Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69883 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72011 invoked from network); 26 Oct 2013 19:23:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Oct 2013 19:23:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=cpriest@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=cpriest@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 66.111.4.28 as permitted sender) X-PHP-List-Original-Sender: cpriest@php.net X-Host-Fingerprint: 66.111.4.28 out4-smtp.messagingengine.com Received: from [66.111.4.28] ([66.111.4.28:49578] helo=out4-smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/F3-45431-DC61C625 for ; Sat, 26 Oct 2013 15:23:58 -0400 Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 51AB0206B6; Sat, 26 Oct 2013 15:23:55 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Sat, 26 Oct 2013 15:23:55 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=YCQVelSvinyeR7n0gx3yxP /blVQ=; b=HnNtc1jy6Pwn7EtH5HkvzsaLH4IOaPhCER5/6zMJ9nOnvCoTIKf5gS 5zarRgf9y9/HIKP/tMekolTd0UQ4Ra2WBWS+2XJR5uR+rlVunq1eQYny+C3LszkJ n8uigHyO0HDZSMh+EnAetZqcKktg7brm6YbaLt4SQu3kI7BVjPX2g= X-Sasl-enc: 9E3nehtWSsrsfgd4fITW71Dc9Je0fW0CAB+KBc+8IlG/ 1382815435 Received: from mail.zerocue.com (unknown [67.200.53.250]) by mail.messagingengine.com (Postfix) with ESMTPA id 152F3C00E8A; Sat, 26 Oct 2013 15:23:55 -0400 (EDT) Received: from [172.17.0.84] (65-111-100-3.static.grandenetworks.net [65.111.100.3]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.zerocue.com (Postfix) with ESMTPSA id 47E4212022E; Sat, 26 Oct 2013 14:23:54 -0500 (CDT) Message-ID: <526C16B7.4090801@php.net> Date: Sat, 26 Oct 2013 14:23:35 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Nikita Popov , PHP internals References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Exceptions in the engine From: cpriest@php.net (Clint Priest) On 10/24/2013 12:41 PM, Nikita Popov wrote: > https://wiki.php.net/rfc/engine_exceptions Very nice Nikita... I like that this patch would provide for very little BC breakage. Given Rowan's list, there would be some changes in behavior but I think that the behavior would be desirable for those that have written their code in this manner (that finally's and destructors will be called, etc). It might even be likely that those who have written code in this manner are not aware that their code isn't being unwound properly, I've run across situations like this before and am always a little leery of writing code that relies on destructors being called since it is not perfectly reliable. On the potential issues: +1 for BaseException -1 for E_RECOVERABLE becoming exceptions because of the BC breakage (execution flow should continue on the next line) +1 for the final error message being reduced to Uncaught EngineException... -1 for not all errors converted, if it's an error that occurs after code execution has begun then they should all be converted for consistency. On other ideas presented as comments: -1 for changing any current errors that let code execution continue (E_WARNING, E_NOTICE, etc) into exceptions. In the end, I think that the current RFC takes it to where it really needs to be: proper unwinding of finally/destructors, better uncaught fatal error information (stack traces). Some other languages go way too far with exceptions and make writing anything in them consist of 30% of the code being try/catch blocks rather than real code. The only thing I would suggest is that it not being a single EngineException, but a few well thought out sub-classes of EngineException. -Clint