php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #5288 bash style case for switch()
Submitted: 2000-06-30 19:47 UTC Modified: 2002-01-27 01:37 UTC
From: Tomas V dot V dot Cox <cox at idecnet dot com> Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.1 OS: Any
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Tomas V dot V dot Cox <cox at idecnet dot com>
New email:
PHP Version: OS:

 

 [2000-06-30 19:47 UTC] Tomas V dot V dot Cox <cox at idecnet dot com>
It could be very usefull if we can have, a bash style switch support. Ex:

switch ($foo){
	case ("1"):
		echo "hello";
		break;
	case ("2"):
		case ("1"): // <-- something like this
		echo "bye";
		break;
}

Thanks

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-27 01:37 UTC] sterling@php.net
No, it would be very wierd.  ;)
seriously, php is not bash, it has a lot of other neat functions/methods to make this work much easier.
 [2014-02-28 17:16 UTC] dsp@php.net
Automatic comment on behalf of cellog
Revision: http://git.php.net/?p=web/pecl.git;a=commit;h=fe3a53c493cb3d5d122cafa94530dd3b9320b3b7
Log: Merge from pearweb fix bug #5288: Wrong REST information for package HTML_Common
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat May 10 22:01:26 2025 UTC