Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76490 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54778 invoked from network); 13 Aug 2014 15:28:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2014 15:28:39 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.180 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.216.180 mail-qc0-f180.google.com Received: from [209.85.216.180] ([209.85.216.180:62060] helo=mail-qc0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1F/D7-11625-5248BE35 for ; Wed, 13 Aug 2014 11:28:37 -0400 Received: by mail-qc0-f180.google.com with SMTP id l6so4101770qcy.25 for ; Wed, 13 Aug 2014 08:28:34 -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=mI8LeF0Qe+a1Zyw3gN2IMgicqx5tsbrs7JqsSdK04Dk=; b=z5KcOiyykZd4IIHyZ9KDu6JfnBMtuJs+N9Hg2afnwGpzDZBvHXdT4jCutG+knYCDFl ZFgfodWnUQMMbCe/m77GDMRoesNro5kJSr4MZColIBIk4CPmCjXn//gR3HtBdwNl4+cT CZf/wVG5yAFPyZJdM18h44KrVxTCAJ1qv5/qO5ZFRZjDa8kghm6RdpWo2cCauBHYee7V KXOg6l/Hus2zBOgoeaY3l9QbYqRriVaHfkoDDZR/zj5ezkUdy6QCU4qzyS55SDPG9bjy Ijuh2K5WIW3x7flaNTt7U1qxuJ2BUSbMZxRiPCpDK9mNe4g65IlVg4m6xYANp5PtY5sz X9AQ== MIME-Version: 1.0 X-Received: by 10.224.75.130 with SMTP id y2mr7969902qaj.72.1407943714295; Wed, 13 Aug 2014 08:28:34 -0700 (PDT) Received: by 10.140.102.111 with HTTP; Wed, 13 Aug 2014 08:28:34 -0700 (PDT) In-Reply-To: References: <53EB3C6A.5010106@gmail.com> Date: Wed, 13 Aug 2014 17:28:34 +0200 Message-ID: To: Kalle Sommer Nielsen Cc: Rowan Collins , PHP Internals Content-Type: multipart/alternative; boundary=001a11c2ef7ef457d505008470d7 Subject: Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement From: tyra3l@gmail.com (Ferenc Kovacs) --001a11c2ef7ef457d505008470d7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Aug 13, 2014 at 5:20 PM, Kalle Sommer Nielsen wrote= : > Hi > > 2014-08-13 13:02 GMT+02:00 Ferenc Kovacs : > > agree, and I thought about mentioning that, but I left that out, becaus= e > > I'm not proposing to remove that ability (and I see more use-cases for > that > > as mentioned in my previous email) but stating that this patch would ma= ke > > an arbitrary distinction between the normal and the default cases. > > In PHP we already disallow overriding $this, like: > > class A { > public function B() { > $this =3D 'hello'; // error > ${'this'} =3D 'hello'; // error > ${'t' . 'his'} =3D 'hello'; // works > } > } > > so agreed too, we cannot disallow such cases that can be variable with > any gain, and it does make sense you cannot with $this, but if you > hack it like above, then you are asking for trouble anyway > > it is offtopic imo, but I also complained about that( https://bugs.php.net/bug.php?id=3D52428) but I think that it is a bit different beast, makes it harder for you to shot yourself to the foot, but the we couldn't find a way to completelly prevent you without noticable performance sacrifice if you go out your way to do so, so I think that the current best-effort approach is ok. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --001a11c2ef7ef457d505008470d7--