Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76489 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52931 invoked from network); 13 Aug 2014 15:20:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2014 15:20:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.49 as permitted sender) X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.215.49 mail-la0-f49.google.com Received: from [209.85.215.49] ([209.85.215.49:53694] helo=mail-la0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/77-11625-1328BE35 for ; Wed, 13 Aug 2014 11:20:18 -0400 Received: by mail-la0-f49.google.com with SMTP id hz20so9335637lab.36 for ; Wed, 13 Aug 2014 08:20:14 -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:date:message-id:subject :from:to:cc:content-type; bh=OLtSQDqvFWM8PFdult4R+Ei/l1dGcK/xVzUZtLZE84E=; b=x4HdF9IJPu+3O+7FFqo9ebdKiIs5mFDWlN6QfckdaW6HlXnOk9VudsJyTYIe1c3vD+ u/Hy1Owo+IgrbAaPZxhYGjNzVv0lICwbATKIOk8H09G5NeuMuZtrqFVU9qTV6SlEzfRV Z/x+8hWWC1smVRN8bcCkIJ12JnujHK4kMCcuu8a4NCA+YvmvPCAFS/3shh3/PRMPNYk5 w1ji/0LuB4VEg0CmjGxm4kwdp2tYRtBVEwGFI0BlKinibhZHWtBGQGjST0stt/+M95/N JBTakoMCGoN/wxt+r/LdcJgN7KncV+eUotaPwCARhilqzta33SBixOrzrduhK4FIVu7z u3qQ== MIME-Version: 1.0 X-Received: by 10.112.87.41 with SMTP id u9mr4851513lbz.97.1407943214587; Wed, 13 Aug 2014 08:20:14 -0700 (PDT) Sender: kalle.php@gmail.com Received: by 10.112.87.161 with HTTP; Wed, 13 Aug 2014 08:20:14 -0700 (PDT) In-Reply-To: References: <53EB3C6A.5010106@gmail.com> Date: Wed, 13 Aug 2014 17:20:14 +0200 X-Google-Sender-Auth: gg_ukSYgtQbAa07L21tqTfzvmxk Message-ID: To: Ferenc Kovacs Cc: Rowan Collins , PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement From: kalle@php.net (Kalle Sommer Nielsen) Hi 2014-08-13 13:02 GMT+02:00 Ferenc Kovacs : > agree, and I thought about mentioning that, but I left that out, because > 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 make > an arbitrary distinction between the normal and the default cases. In PHP we already disallow overriding $this, like: class A { public function B() { $this = 'hello'; // error ${'this'} = 'hello'; // error ${'t' . 'his'} = '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 -- regards, Kalle Sommer Nielsen kalle@php.net