#46095 [Opn->Bgs]: avoiding some duplicated code (switch)

From: Date: Tue, 16 Sep 2008 15:27:06 +0000
Subject: #46095 [Opn->Bgs]: avoiding some duplicated code (switch)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-129021@lists.php.net to get a copy of this message
ID: 46095 Updated by: mkoppanen@php.net Reported By: abdallah at gmx dot com -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: Windows XP SP3 PHP Version: 5.2.6 New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Please read http://php.net/switch with care. Previous Comments: ------------------------------------------------------------------------ [2008-09-16 13:57:54] abdallah at gmx dot com Description: ------------ I think the switch instruction should allow a nice technique for the default case: like this : Reproduce code: --------------- switch ($x): case 'a': //some code (eg. 10 lines) break; case 'b': //some other code (eg. 10 lines) break; case 'n': //etc... break; // And then what that should be nice default: goto case 'a'; break; endswitch; Expected result: ---------------- Avoid the duplication of the content of case 'A' if we need the default case to act same case 'A'. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46095&edit=1

« previous php.bugs (#129021) next »