ID: 49993 User updated by: sworddragon2 at aol dot com Reported By: sworddragon2 at aol dot com Status: Bogus Bug Type: Scripting Engine problem Operating System: Windows XP Professional SP3 PHP Version: 5.3.0 New Comment:
I have allready read the documentation. Maybe it's a misunderstanding because the switch documentation isn't translated in my language but the documentation says the following: A special case is the default case. This case matches anything that wasn't matched by the other cases. For example: If this issue is working correctly the documentation is wrong i think. Previous Comments: ------------------------------------------------------------------------ [2009-10-25 23:35:50] [email protected] Please read the documentation on switch/case (for any language) carefully. This is expected behaviour. Hint, read about "break". ------------------------------------------------------------------------ [2009-10-25 23:33:08] sworddragon2 at aol dot com Description: ------------ In this example default is triggering although the case statement is triggering before. Reproduce code: --------------- switch(1) { case 1: echo "case 1: triggered\n"; default: echo 'default: triggered'; } Expected result: ---------------- case 1: triggered Actual result: -------------- case 1: triggered default: triggered ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49993&edit=1
