Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70532 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54913 invoked from network); 8 Dec 2013 13:55:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2013 13:55:10 -0000 Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain zend.com from 209.85.128.178 cause and error) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 209.85.128.178 mail-ve0-f178.google.com Received: from [209.85.128.178] ([209.85.128.178:63660] helo=mail-ve0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BC/67-01020-C3A74A25 for ; Sun, 08 Dec 2013 08:55:09 -0500 Received: by mail-ve0-f178.google.com with SMTP id c14so2688046vea.23 for ; Sun, 08 Dec 2013 05:55:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:content-type; bh=YWN/CPkSELxAGZWRfaCn0PTGKIbVOxEmsnu9cC+yrsY=; b=CIdNqY79wj7v54M1SuS45jCEOrUvP3WQTqxMzruxTAmUqM6w7hXM2zjZU08yi/xPIL BLxruH1JhLOtatetcg66bvzNCw1Qice0mxHMmqHv1byqzHDYwPy2xQytcdQ1USmsqZ2Q INEHSuOoxE9m7mlQQNONtdubAreKJK+rFD5ZGYcKQ2hKzixV2x8OiYKMVF44ol2p1Gcw y2bmnVk93xRlwwga6kKHXjtd0r7OLLYQNaJjM5NRUPP9DpPHiILInvZj23Quuuw8B48T rBnwlrYlbnBzyjI9k/EZZnZgOhSe6B1Um2Cms75qStK/uTbfopKMra6oUEgjfROBpY7V iwRQ== X-Gm-Message-State: ALoCoQnISqpcqFdc6qYuxtotdcywzoT0G5JgeUhsYrw/y8P4eCpMrBm6y2m1iDOU+7ojl/li0QadTdUURk3w2IsTh3w84Z0TVjwtmOWNKxFYxyF3KZxu4f9aW5uflhMJ7rwuoqi0egVn X-Received: by 10.58.233.98 with SMTP id tv2mr8306367vec.11.1386510906047; Sun, 08 Dec 2013 05:55:06 -0800 (PST) References: In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGgDrPA5ha5cbTVFKdEKPSDNh1cIZqoGGRg Date: Sun, 8 Dec 2013 15:55:04 +0200 Message-ID: To: Nikita Popov , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: RE: [PHP-DEV] [VOTE] Allowing use of exceptions in the engine From: zeev@zend.com (Zeev Suraski) Nikita, Apologies for not having followed the discussion a few weeks ago but I think this proposal can't be accepted as it is even if everyone likes it. It breaks a very basic design concept in the way both the engine code as well as extension code is written - execution will never resume beyond an E_ERROR. Allowing execution to resume (through the use of exceptions) opens a huge can of worms, and sets expectations we can't meet. In fact, the main difference between E_ERROR and E_WARNING is the recoverability, so this is not some small detail we can fix - we simply can't assume execution can continue after an E_ERROR is triggered, because E_ERROR in its very essence implies no-resumed-execution. That's also the reason error handlers (that existed before exceptions did) don't handle E_ERROR. I don't think a vote makes a lot of sense here, since it's asking people whether they're in favor of the concept of being able to recover from any kind of error. That's the wrong question (to which, by the way, I'd vote 'yes'). The real question is whether people are OK that the engine will start randomly crashing through the use of standard PHP code, which is pretty much out of the question. If there are E_ERROR's which you think are erroneously tagged as E_ERROR's and should in fact be E_RECOVERABLE_ERROR, we should change them, rather than assuming that E_ERRORs can be tagged as recoverable wholesale... Disclaimer: Perhaps I'm missing something. I also asked Dmitry to take a closer look at this... Zeev > -----Original Message----- > From: Nikita Popov [mailto:nikita.ppv@gmail.com] > Sent: Saturday, December 07, 2013 2:58 PM > To: PHP internals > Subject: [PHP-DEV] [VOTE] Allowing use of exceptions in the engine > > Hi internals! > > I opened the vote on the "Exceptions in the engine" RFC: > > https://wiki.php.net/rfc/engine_exceptions#vote > > The vote has three options, "Yes", "No" and "Yes, without > E_RECOVERABLE_ERROR changes". The last option is a version of the > proposal without BC issues. > > Some further notes: > * I will not be including something like BaseException. Introducing it for this > purpose seems like bad design and will be very hard to get rid of in the > future. As the proposal (without recoverable errors) does not break BC [1] > even without it, I don't see a reason to introduce it. > * Some people suggest to use different subclasses of EngineException for > different error types. I'm not against that, but I think it's okay to do that in a > separate proposal, if someone can come up with a good selection of > exception classes. It's much easier (and does not break BC) to add > subclassing later, than to add suboptimal subclass types now and try to fix > something like the SPL exception mess later. > * The suggested uncaught exception error message change is just a bit of > cosmetics (and not directly related to this proposal), so I'd like to do that > separately. > > And regarding the vote: If you are in favor of the proposal in general, but > want to have it in PHP 6 rather than PHP 5.6, then vote "No" here. If it fails > now, someone can revive this once the time for PHP 6 has come. > > Thanks, > Nikita > > [1]: We don't have a formal definition for this, but it seems to be general > consensus that relaxing error conditions does not constitute a backwards > compatibility break.