Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61543 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87167 invoked from network); 20 Jul 2012 07:47:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2012 07:47:56 -0000 Authentication-Results: pb1.pair.com header.from=ajfweb@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajfweb@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.212.176 as permitted sender) X-PHP-List-Original-Sender: ajfweb@googlemail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:60118] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AF/58-18983-B2D09005 for ; Fri, 20 Jul 2012 03:47:55 -0400 Received: by wibhn17 with SMTP id hn17so158544wib.11 for ; Fri, 20 Jul 2012 00:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CE9TSBqOke3qUWxUPw5np/k9FCMddeUwy+q6fk7Ky9c=; b=JRk+Dl+AfCwygu+KXTzyS/H9DIBKGc8l+nhw0h3IHDq8TCd7PV4jG4N2PtBhtgKrqR hLcA559lCozkuAr3NseUhZH1WeSZH4dyPcx2IyIZOuh/VTzFxo4uUhqp6O469NCl+ThY 3FuijRUA//4Q261uL8Zc/Xr5QkccLWAYuMZGiKVyvcq2TpDDfnZs7yN1OgaQ0V5ItEor 1GhGyjpYH3mEgNUDR/CEm3La+SYxhzlpmbsQuEIvglRNfyDiy9yt8RvVHb8oeLxf/2pj djXNnbNL8M0ZhDuapyToleUoKlz/rQSDtEa7hKYJ9FjOX+tL2rHwtFo5Q6OzD6gtn4ei dLqw== MIME-Version: 1.0 Received: by 10.216.118.72 with SMTP id k50mr1150385weh.224.1342770472114; Fri, 20 Jul 2012 00:47:52 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Fri, 20 Jul 2012 00:47:51 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Fri, 20 Jul 2012 00:47:51 -0700 (PDT) In-Reply-To: References: <5007D707.2070100@hoa-project.net> <095CAA408DA94AFB9E75C12877A9043D@charliesomerville.com> <36467402DA0F4332A523162E3C278042@gmail.com> Date: Fri, 20 Jul 2012 08:47:51 +0100 Message-ID: To: Amaury Bouchard Cc: internals@lists.php.net, Reeze Content-Type: multipart/alternative; boundary=e0cb4efa789a015bbb04c53e1d10 Subject: =?UTF-8?B?UmU6IFtQSFAtREVWXSDlm57lpI3vvJogW1BIUC1ERVZdIE1ha2UgdHJ5L2NhdGNoIGJyYQ==?= =?UTF-8?B?Y2tldHMgb3B0aW5hbA==?= From: ajfweb@googlemail.com (Andrew Faulds) --e0cb4efa789a015bbb04c53e1d10 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I don't think we should add it purely for consistency, because then we'd have to allow nonsense like: switch x; case 1; endcase; endswitch; or... try; x; catch e; endtry; Sure, consistency is good, but this would allow sloppy code. On Jul 20, 2012 8:36 AM, "Amaury Bouchard" wrote: > 2012/7/19 Reeze > > > =E5=9C=A8 2012=E5=B9=B47=E6=9C=8819=E6=97=A5=E6=98=9F=E6=9C=9F=E5=9B=9B= =EF=BC=8C=E4=B8=8B=E5=8D=886:45=EF=BC=8CRune Kaagaard =E5=86=99=E9=81=93=EF= =BC=9A > > > > > +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 =3D 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). > --e0cb4efa789a015bbb04c53e1d10--