Req #38487 [Com]: Improving switch statement

From: Date: Sun, 06 Sep 2015 18:28:01 +0000
Subject: Req #38487 [Com]: Improving switch statement
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195814@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=38487&edit=1

 ID:                 38487
 Comment by:         david dot proweb at gmail dot com
 Reported by:        dtyschenko at soft-ukraine dot com
 Summary:            Improving switch statement
 Status:             Open
 Type:               Feature/Change Request
 Package:            Feature/Change Request
 PHP Version:        5.1.5
 Block user comment: N
 Private report:     N

 New Comment:

It'll be a problem because of PHP structure. But maybe use/create a keyword to receive the case
value.

    switch ($a instanceof case) {
        case Foo : echo "Foo"; break;
        case Bar : echo "Bar"; break;
        default : echo "Unknown" : break;
    }


Previous Comments:
------------------------------------------------------------------------
[2006-08-18 02:07:16] dtyschenko at soft-ukraine dot com

Description:
------------
I think use switch in case like this will be very useful  

Reproduce code:
---------------
<?php
	switch ($a instanceof) {
		case Foo : echo "Foo"; break;
		case Bar : echo "Bar"; break;
		default : echo "Unknown" : break;
	}
?>



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=38487&edit=1


Thread (3 messages)

« previous php.bugs (#195814) next »