Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76502 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10605 invoked from network); 14 Aug 2014 00:33:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2014 00:33:57 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.67 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.67 smtp67.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.67] ([108.166.43.67:35372] helo=smtp67.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/70-07085-3F30CE35 for ; Wed, 13 Aug 2014 20:33:55 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp9.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 3150E380517; Wed, 13 Aug 2014 20:33:52 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp9.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id DF5C138051E; Wed, 13 Aug 2014 20:33:51 -0400 (EDT) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local ([UNAVAILABLE]. [74.85.23.222]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.2.10); Thu, 14 Aug 2014 00:33:52 GMT Message-ID: <53EC03EF.1050009@sugarcrm.com> Date: Wed, 13 Aug 2014 17:33:51 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Rowan Collins , "internals@lists.php.net" References: <53EB3C6A.5010106@gmail.com> In-Reply-To: <53EB3C6A.5010106@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Disallow multiple default blocks in a single switch statement From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > And this, which is completely undetectable at parse time: > > $bar = 30; > // ... arbitrary amount of code > switch ( $foo ) { > case $bar: > case 30: > } That's not all. You can also do: switch (true) { case foo($bar): ... case baz($quz, $qux): ... } and this is a completely valid code which I've seen in the field. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/