Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67805 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22589 invoked from network); 25 Jun 2013 12:50:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jun 2013 12:50:33 -0000 Authentication-Results: pb1.pair.com header.from=florinpatan@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=florinpatan@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.177 as permitted sender) X-PHP-List-Original-Sender: florinpatan@gmail.com X-Host-Fingerprint: 209.85.223.177 mail-ie0-f177.google.com Received: from [209.85.223.177] ([209.85.223.177:61209] helo=mail-ie0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 61/2F-49518-71299C15 for ; Tue, 25 Jun 2013 08:50:31 -0400 Received: by mail-ie0-f177.google.com with SMTP id aq17so27543813iec.22 for ; Tue, 25 Jun 2013 05:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=swcp5mNCRbanEx3Kc02xmMUc5LR4ULvQy/N8FsL3VdM=; b=noo4KFd1vfjfrXUmpKFjv4vvBBCdAXKvS8sdYvsWlhzQlyDVTcFVwoykP1qhrTf561 20V6Fx8LcjY++sk6x4NN60pjfaAUI2u21FIdT+IlVNhNNyv+/SORZC7YwldP5yEdur61 p+zCLMr29l8Po8jbpowjH0Kw2Pbp/0BQpTPp1Hrl1pYiHWTMoHzneDFfnm+EBntaJMA4 /vj08gQ1Ez+PBPAtZQq9wGijq+BTRP7XTO8lJdx4hlfAumy2vciciZcrw9EGiWXUwL1f vI50HwozKXEbt/5Fel2Gmmi5ByAIdWqG+MKtyExZ1oeAPnDoDjIsur1zveSKi3W329C2 dQ7g== X-Received: by 10.50.128.11 with SMTP id nk11mr8522521igb.26.1372164628577; Tue, 25 Jun 2013 05:50:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.114.73 with HTTP; Tue, 25 Jun 2013 05:49:58 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 Jun 2013 14:49:58 +0200 Message-ID: To: Joost Koehoorn Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Announcing RFC 'Anonymous Catches' From: florinpatan@gmail.com (Florin Patan) 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 > > Regards, > > Joost Koehoorn > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > Hi, First of, considering that you would only save three characters by having the ' $e' removed, I don't see how it would make things easier to learn. I mean if you can't learn that maybe you should look into something else that's not related to programming :) Having this: "* Avoid indication of a specific exception type" could be considered as a possible bad practice, just as you were saying that catch(\Exception $e) is. Also, it you can add the other ten characters that you save when typing \Exception but does it worth it? How do you plan to handle this: * Note that there may only be one anonymous catch-statement, and it has to be the last one. Throw a fatal error? If not then what, nothing? What are the performance downsides of having this check in place? I do understand that you mentioned: "* Runtime needs to perform less checks. No need to update the symboltable, no need to check exception inheritance. " but wouldn't that be replaced by what I'm asking about? If I could read/understand C better I wouldn't ask for this. Could you also please elaborate this: "* Better possibilities for static analysis tools"? As for: * People from other languages such as C#, Python and Ruby expect this to work I think it is often pointed out when requesting features such as function/method return type hinting (I'm planning a RFC for that), named parameters, threads and other stuff that this ain't C#, Java, Python, Ruby or whatnot so.. what's the official position on this? Do we want PHP like the other languages or not (and I won't say more on this here/now)? Also, the code sample is not that good. If you want to reflect a good quality scenario, it should be more like: while (true) { try { $this->connectToServer(); break; } catch (ConnectionFailedException) { sleep(3); } } And I think the RFC should also add a: Disadvantages section so that it could help people looking on it and proving that you've done all the research correctly. Thanks ---- Florin Patan https://github.com/dlsniper http://www.linkedin.com/in/florinpatan