Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76373 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32762 invoked from network); 6 Aug 2014 10:19:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Aug 2014 10:19:45 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.179 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.179 mail-we0-f179.google.com Received: from [74.125.82.179] ([74.125.82.179:40689] helo=mail-we0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2A/D2-13038-F3102E35 for ; Wed, 06 Aug 2014 06:19:44 -0400 Received: by mail-we0-f179.google.com with SMTP id u57so2380801wes.10 for ; Wed, 06 Aug 2014 03:20:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=JSKPAkTRZNpnQgY7hYaOMvbOwC2hVYZS7ZJm7WT1bZs=; b=CrcAj75ZE3SawiIr3KDX5pXrF3D6XxmIqqCq/Qkr2Cvj05vMUy+xm7E3omqiduV2/3 Td2nJrLqzTgBanKO4LrecazkIWbF14PJ/DJ2Luun73jzJWUbAPIi1UIYGbu6N+U7UN9p nl3F8C2pBXZ6e6OIaIJ6JgGWazWxQN4Y26sVfh50cdiAef4DsaUN/qG0qOfIk1qvvs3+ djK0jdnZ2z4AtkKUNG6b5rj1LwywlS7BbXL34yBFSuShSs9tq1kGuIY8ucWjVtLxQVmb +sfKzLydl9tM3NVviEqn1Y1DhBC5Nbl/5JevFz9ZWWOyBYLnAD9tvDE7WrOu++Ob4tAN 97Yg== X-Received: by 10.180.74.240 with SMTP id x16mr48720582wiv.13.1407320410951; Wed, 06 Aug 2014 03:20:10 -0700 (PDT) Received: from [192.168.0.177] ([62.189.198.114]) by mx.google.com with ESMTPSA id w7sm16865824wiy.6.2014.08.06.03.20.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Aug 2014 03:20:10 -0700 (PDT) Message-ID: <53E2006E.6080809@gmail.com> Date: Wed, 06 Aug 2014 11:16:14 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement From: rowan.collins@gmail.com (Rowan Collins) Ferenc Kovacs wrote (on 06/08/2014): > Hi, > > I think dropping this behavior is a good idea, but I'm confused by the > reasoning related to the langspec. > This rfc targets php.next (which is a safe move as this has BC break albeit > would require some questionable code), but the langspec was agreed to be > based on 5.6 and document how that works. > So even if we accept this rfc, and remove the multiple default case, > wouldn't we still need to document the current behavior in the spec (maybe > mentioning that it will go away in php-net)? According to the bug report, HHVM also accepts multiple default blocks, but uses the first rather than the last. It's probably not worth implementing specific code there to take the last default label just in order to adhere to a 5.6 spec, but is worth making it detect multiple labels to bring it in line with the proposed change. So either we declare the php.net implementation to be in violation of the spec (which isn't completely insane - the spec shouldn't mirror behaviour to the point of incorporating the entire bug list); or we document the php.net behaviour as "correct", but accept that nobody is going to implement that part of the spec as written, and fix it in the next release of both the implementation and the spec. Having the 5.6 spec match behaviour, and starting a 5.7 draft immediately for implementations to actually target might be a compromise? -- Rowan Collins [IMSoP]