Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67788 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28214 invoked from network); 24 Jun 2013 23:49:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jun 2013 23:49:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=joost.koehoorn@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=joost.koehoorn@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.172 as permitted sender) X-PHP-List-Original-Sender: joost.koehoorn@gmail.com X-Host-Fingerprint: 74.125.82.172 mail-we0-f172.google.com Received: from [74.125.82.172] ([74.125.82.172:56340] helo=mail-we0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 89/1D-49518-80BD8C15 for ; Mon, 24 Jun 2013 19:49:28 -0400 Received: by mail-we0-f172.google.com with SMTP id q56so8680940wes.17 for ; Mon, 24 Jun 2013 16:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type:content-transfer-encoding; bh=Hg4WK2kSfOoLVrn0dF01xYjEOKA1yhRwHqKl6B8JysY=; b=TGCRqe8B4zPzlJ8i18XqSxEdHB3J2QJTCnebcnJyBUZS9EUrySisLbSnNh1VKWCPzh O7fPt3Z949aCrzvr1siPXVL8tclTffjTzr8ycl/VDmgk78kvRbYNL6O9HTs6oE12b+X9 jUUo+tGzqYFomF3hVagKTp8d0Tefnx4GrhrItP7/xTvFZoscO5jTtX3diAWs8s/lP/O/ iJk4Tj6z1lrnM8lhD4Ge1Sqlq5ATFi/oTBsSKjdJY/UGzD5pjhDd7yZLbRD4rjSHNtIz jPafwZXAWlBf82cezM4vLs4+R0Wy3RmHovK8Yj3OF91y1QhAg1DGLLWdg6kWFUWxqiLZ JXGw== X-Received: by 10.194.60.5 with SMTP id d5mr18287019wjr.26.1372117764861; Mon, 24 Jun 2013 16:49:24 -0700 (PDT) Received: from MacBook-Air-van-Joost-Koehoorn.local (178-85-180-81.dynamic.upc.nl. [178.85.180.81]) by mx.google.com with ESMTPSA id cw8sm616048wib.7.2013.06.24.16.49.23 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 24 Jun 2013 16:49:23 -0700 (PDT) Date: Tue, 25 Jun 2013 01:49:22 +0200 To: Anthony Ferrara Cc: "=?UTF-8?Q?internals=40lists.php.net?=" Message-ID: In-Reply-To: References: X-Mailer: Airmail Beta (183) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: =?UTF-8?Q?Re=3A_Announcing_RFC_'Anonymous_Catches'?= From: joost.koehoorn@gmail.com (Joost Koehoorn) On 25 juni 2013 at 01:20:04, Anthony =46errara (ircmaxell=40gmail.com) wr= ote: Joost, =46irst off, let me say welcome and thanks for the contribution=21 I have a couple of questions around the intended proposal. 1. How do you plan on handling the case where there are multiple catch bl= ocks=3F =C2=A0 =C2=A0 try =7B =C2=A0 =C2=A0 =C2=A0 =C2=A0 code(); =C2=A0 =C2=A0 =7D catch =7B =C2=A0 =C2=A0 =C2=A0 =C2=A0 doSomething(); =C2=A0 =C2=A0 =7D catch =7B =C2=A0 =C2=A0 =C2=A0 =C2=A0 doSomethingElse(); =C2=A0 =C2=A0 =7D As mentioned as latest sentence in the Proposal chapter, an anonymous cat= ch can only be used as the latest catch, and there can only be one of the= m. This is also how my current implementation works. 2. You mention as a benefit =22Better possibilities for static analysis t= ools=22. Can you elaborate on this=3F I don't see how this sort of a chan= ge would have any effect (as catch would be the same as the existing =60c= atch (=5CException =24e)=60)... It's mostly for finding unused variables. I suppose that static analysers= currently ignore unused exception variables, but they don't have to when= this is accepted and can properly indicate unused exception variables. 3. What benefit short of not having to type =60(=5CException =24e)=60 wou= ld this have=3F Populating the symbol table is extremely cheap at this st= age, because the variable is already compiled in (so no hash table lookup= or anything). Performance wise it's indeed very minor and doesn't really matter. It's m= ore that you're adding code indicating that only a specific exception is = used, while that may not really be the case. Consider Java people --Java has Throwable as the superclass of Exception-= - they may not know that in PHP 'Exception' is the least-specific type an= d therefore used as catch-all. As for leaving of the variable, the type of an exception mostly tells eno= ugh about what happened (well, it should), so you don't have to inspect t= he exception's error code/message and thus don't need the exception objec= t at all. Additionally, I would recommend changing the version target to 5.NEXT (wh= ich would be 5.6 in practice). Done=21 As far as my personal feelings, I'd like to get some other commentary fir= st. Thanks again=21=21=21 Anthony