Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61540 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83018 invoked from network); 20 Jul 2012 07:35:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2012 07:35:51 -0000 Authentication-Results: pb1.pair.com header.from=amaury.bouchard@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=amaury.bouchard@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: amaury.bouchard@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gh0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:51275] helo=mail-gh0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/77-18983-55A09005 for ; Fri, 20 Jul 2012 03:35:49 -0400 Received: by ghbg2 with SMTP id g2so4227823ghb.29 for ; Fri, 20 Jul 2012 00:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=veqvT32K6VzlQwHlc3yAPvaW2aARSe0oEfyr6SV1YLw=; b=YIEnDnB0LtenGDS5lVOi2NjbaICZ873puEOVztwJ72DLE09W4fOTat1+vxe4vm0Pu1 onQDgah/bhnqUNBAT5KGs6aYEL0z09Hu0JWHl4/vDm5rSbR2b1a9nK7v4p6wYaG2v7bi +42cyqxRuTDFSC2K+p59/n+1cL3f7ZKWH2Ajr5sePdXU+OP47StY+nsKirhb8CexH/Gl bU/Y2cQS1lvdo+oLlBAjB/RCxnuVmjfrOqOqyEnK/tHe/k27MbQyPVlfOOrOSypbb12x g/Q3oBfmvFjo8pNZZht5Oknvm0TMKkcOqsQusYKXBrzgzSayfZqd8wDXVn59a9JRUohS O9Gg== Received: by 10.60.171.174 with SMTP id av14mr5615869oec.61.1342769746354; Fri, 20 Jul 2012 00:35:46 -0700 (PDT) MIME-Version: 1.0 Sender: amaury.bouchard@gmail.com Received: by 10.182.149.69 with HTTP; Fri, 20 Jul 2012 00:35:26 -0700 (PDT) In-Reply-To: <36467402DA0F4332A523162E3C278042@gmail.com> References: <5007D707.2070100@hoa-project.net> <095CAA408DA94AFB9E75C12877A9043D@charliesomerville.com> <36467402DA0F4332A523162E3C278042@gmail.com> Date: Fri, 20 Jul 2012 09:35:26 +0200 X-Google-Sender-Auth: pvMbX61ivkY9spPBElj3fZEb0m0 Message-ID: To: Reeze Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=bcaec54a3252bf206a04c53df166 Subject: =?UTF-8?B?UmU6IFtQSFAtREVWXSDlm57lpI3vvJogW1BIUC1ERVZdIE1ha2UgdHJ5L2NhdGNoIGJyYQ==?= =?UTF-8?B?Y2tldHMgb3B0aW5hbA==?= From: amaury@amaury.net (Amaury Bouchard) --bcaec54a3252bf206a04c53df166 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit 2012/7/19 Reeze > 在 2012年7月19日星期四,下午6:45,Rune Kaagaard 写道: > > > +1 for the consistency of it. It's surprising that: > > > > if ($foo) > > return $bar; > > else > > return 42; > > > > works and: > > > > try > > maybe_dangerous(); > > catch(Dynamite $e) > > handle_error(); > > > > > > There is no condition after `try`, it's really hard to read without > bracket. > it becomes even worse if it didn't format pretty as above. > Bad argument. It's not about the presence of a condition after "try". It's about language consistency. If you were right, we shouldn't be able to write that: $i = 0; do echo($i++); while ($i < 3); PHP allows it. Nobody cares about it, while I think it's a very ugly writing. But everybody is accustomed to it, because it's inherited from C syntax. And bracketless try/catch doesn't exists in other languages, so it shouldn't exists in PHP? More, do not confuse coding conventions (depends on people, changes from time to time) and language syntax (should be stable and consistent). --bcaec54a3252bf206a04c53df166--