Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67808 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42883 invoked from network); 25 Jun 2013 15:07:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jun 2013 15:07:35 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.54 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.54 mail-oa0-f54.google.com Received: from [209.85.219.54] ([209.85.219.54:48570] helo=mail-oa0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8C/03-49518-632B9C15 for ; Tue, 25 Jun 2013 11:07:34 -0400 Received: by mail-oa0-f54.google.com with SMTP id o6so13403434oag.41 for ; Tue, 25 Jun 2013 08:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=0rvjUjJl8eD0xdB7SgmAablA3KAj8/zb8LFi+jaKT4E=; b=QKdcFjgO6meYMvBG242Bu5Sh4yvHlyfNtafPupC0PB1luIwzZQh5OKKwAUe0H6bA4k WkOUmuX3ZYMlK34D+a2GYeU/KVV5jTffNKOxUEuSxXhKX81Uh0/3KBleRmdfnNRyrpaE d/fi/8LHuJEMixpr3fwWrc1KjKUEk3GsIp0pzOpbQhi2MP3B5hHKsK9dA1Sq87TcfKS0 1yW8F4ju2GClYaqHGQusLz9ROcwgZTAIcFGXIor6xA6RiE9SJnHv0N7X3HtU6ei1iTMY fh5EAJBhNzvNlg9rGD/Tn6L2DreL2pFEkwBV+50tQBQsdlmPLsFl0WtKuV5E8OmcS6i5 REVw== MIME-Version: 1.0 X-Received: by 10.60.146.202 with SMTP id te10mr9556055oeb.13.1372172852108; Tue, 25 Jun 2013 08:07:32 -0700 (PDT) Received: by 10.182.89.170 with HTTP; Tue, 25 Jun 2013 08:07:32 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 Jun 2013 17:07:32 +0200 Message-ID: To: Joost Koehoorn Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7b5d46286ba3f804dffbe38f Subject: Re: [PHP-DEV] Announcing RFC 'Anonymous Catches' From: nikita.ppv@gmail.com (Nikita Popov) --047d7b5d46286ba3f804dffbe38f Content-Type: text/plain; charset=ISO-8859-1 On Tue, Jun 25, 2013 at 12:54 AM, Joost Koehoorn wrote: > Hi all, > > I just published an RFC that proposes to add catch-statement without > needing to specify a variable, and support for fully anonymous catches. > > Details can be found at: > > https://wiki.php.net/rfc/anonymous_catch > No opinion on leaving off $e, but I'm against the generic catch{} statement. Looking at the Python docs, they don't see particularly fond of the wildcard-except themselves: > The last except clause may omit the exception name(s), to serve as a wildcard. Use this with extreme caution, since it is easy to mask a real programming error in this way! It can also be used to print an error message and then re-raise the exception (allowing a caller to handle the exception as well): Furthermore a wildcard-catch is bad for forwards compatibility. Right now all exceptions extend Exception, but this doesn't have to stay so. E.g. Python has additional exceptions above that for handling stuff like signal interrupts or die()s and I think it's not unlikely that we will introduce something like this in PHP too. You normally do *not* want to catch those, but a wildcard-catch would do this. Thus I think it's better to stays explicit and keep it at catch(Exception). Nikita --047d7b5d46286ba3f804dffbe38f--