Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77794 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49699 invoked from network); 7 Oct 2014 08:55:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Oct 2014 08:55:21 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.212.182 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:42326] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 73/B5-30869-77AA3345 for ; Tue, 07 Oct 2014 04:55:20 -0400 Received: by mail-wi0-f182.google.com with SMTP id n3so7139874wiv.3 for ; Tue, 07 Oct 2014 01:55:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=VCKImeZR+DtxIBBNP3Sh4QwGKVnaZzIKk/EdhJk0NI0=; b=Wc4aZk6oBQ+6+fVrW3IpKDY7ppY18sSJOAsVtPqqnPx5uqvxdtIMsd/jPgqBR6vdf7 kHudM7rHKhsw4cBqXl3yHHzWcplo+hmVBTdUzAyMxa9Dx/lVf0CjnoSUm60zONIkakDd M04VaFnBWnXL5Bhbeb+DDqinYtt/s38Uwve1qIFPeN4jt63RB/+gJ7VbSZmJe6hnf3MI X2XYW/pcXvSzpFNKrgt552Z9pt0Z0kXLVJtrEhaVeW7ibRb+/PgqtJzUw7EfMVuc56MU j64EQN8S1ephwKsMQvqMwGumGaTTEF/uQAjl0HPhbp1M5VS74CTkfNI5oHeK4pXAXdzy ctTQ== X-Gm-Message-State: ALoCoQnsLBk1Vs5SnMcJ4Q/idmemIQBEIxIHnT0gAsSYvg81+xTT4iV40j4nQCZP4aep9/EQoOUl MIME-Version: 1.0 X-Received: by 10.194.240.227 with SMTP id wd3mr3076857wjc.29.1412672117149; Tue, 07 Oct 2014 01:55:17 -0700 (PDT) Received: by 10.216.82.1 with HTTP; Tue, 7 Oct 2014 01:55:17 -0700 (PDT) X-Originating-IP: [78.145.248.73] In-Reply-To: <543320AB.4070606@sugarcrm.com> References: <543320AB.4070606@sugarcrm.com> Date: Tue, 7 Oct 2014 09:55:17 +0100 Message-ID: To: Stas Malyshev Cc: Nikita Popov , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Exceptions in the engine From: danack@basereality.com (Dan Ackroyd) Stas wrote: > 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. It's not clear why would that be an issue - can you specify what the problem would be? Also, if we changed `catch(Exception $e)` to not catch all exceptions, than we would need to have another way of specifying that a catch block should catch all exceptions. Which would involve either making \Exception extend another even 'baser' Exception, or a hack to the syntax e.g. something like: catch($e) { // Catch without Exception type catches all exceptions // and confuses people. } cheers Dan Ack On 7 October 2014 00:07, Stas Malyshev wrote: > 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/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >