Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76483 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37859 invoked from network); 13 Aug 2014 13:19:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2014 13:19:14 -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.192.52 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.192.52 mail-qg0-f52.google.com Received: from [209.85.192.52] ([209.85.192.52:44574] helo=mail-qg0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2A/E4-11625-0D56BE35 for ; Wed, 13 Aug 2014 09:19:13 -0400 Received: by mail-qg0-f52.google.com with SMTP id f51so10453157qge.25 for ; Wed, 13 Aug 2014 06:19:10 -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=1DpyDEQ1eEPloSMQW+vATf+Ty5ffWsyyXA1sR/O73M4=; b=cfAuL/4ulO5ylIkOHHhE2yml8RhKvGCWAnrwl1WvVSCoyVCY9a54vQb4EMjlO+kCno CubRbd5kXs1sW+YN5ja4SpzYwOTfqZQKcBsqmeyRfvVePgCZEWkn76uVdBuLRulfKcY2 uYgyXlv+YqT28+jJFjacMEHlraRo26WMwRM4iRscN7nrRb621jf9mk9lBTtite4KVXCW TIUsGdCO0aIekLIdoMdHpFa9YKA9Z3u2fweFWl1QCQUH/sIWh9Q59IHKCBUzWpU+vVuC oQbn6kq4v8kMAYdPQkKzgyMokWk7DEVwIKma5Nbb63PCbgaKrm3owc0uc9ACLHHvA7GK CwkA== MIME-Version: 1.0 X-Received: by 10.140.102.117 with SMTP id v108mr6079631qge.93.1407935950174; Wed, 13 Aug 2014 06:19:10 -0700 (PDT) Received: by 10.140.102.111 with HTTP; Wed, 13 Aug 2014 06:19:10 -0700 (PDT) In-Reply-To: <53EB6103.4090600@gmail.com> References: <53EB3C6A.5010106@gmail.com> <53EB59AD.6020100@gmail.com> <53EB6103.4090600@gmail.com> Date: Wed, 13 Aug 2014 15:19:10 +0200 Message-ID: To: Rowan Collins Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c16ec42d4de6050082a29d Subject: Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement From: tyra3l@gmail.com (Ferenc Kovacs) --001a11c16ec42d4de6050082a29d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Aug 13, 2014 at 2:58 PM, Rowan Collins wrote: > Ferenc Kovacs wrote (on 13/08/2014): > >> Btw. I've added a comment to https://bugs.php.net/bug.php?id=3D67757 as >> I've found some really weird behavior for multiple defaults and I think >> that it would be better to try to figure out and fix why do we pick the >> last default in the problematic snippet instead of trying to remove the >> multiple default support to get rid of the setup which can make this bug= to >> surface. >> > > You're misinterpreting the behaviour of http://3v4l.org/r3poR > > It is not selecting the first default, it just never needs to look for a > default, because it has already found a matching case label. > yes, and it continues the execution from the first matching case and correctly evaluates the following defaults, as default matches everything, which imo should be the correct behavior. > > If you supply a value which requires the default label to be selected, th= e > last default label will be selected, as in all other examples to date: > http://3v4l.org/lQ7WE > having a different behavior for default when there is a preceeding matching empty case is not the expected(from the userland point of view) behavior imo. ps: sorry for the imprecise/lousy definitions on my part, I hope I can get my message through though. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --001a11c16ec42d4de6050082a29d--