|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-06-04 05:36 UTC] waps at pisem dot net
Description:
------------
SWITCH statement incorrect work from data types. In exemple I write code.
Reproduce code:
---------------
$strCode = 0;
switch( $strFileType )
{
case 'jpg':
case 'jpeg':
echo 'point 0';
break;
case 'gif':
echo 'point 1';
break;
default:
echo 'point 3';
}
Expected result:
----------------
echo string "point 0"
Actual result:
--------------
I have to view "point 3", but no "point 0"
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 24 08:00:02 2025 UTC |
Old excampe incorrected! This excemple correct: $strCode = 0; switch( $strCode ) { case 'jpg': case 'jpeg': echo 'point 0'; break; case 'gif': echo 'point 1'; break; default: echo 'point 3'; }<?php $strCode = 0; switch( $strCode ) { case 'jpg': case 'jpeg': echo 'point 0'; break; case 'gif': echo 'point 1'; break; default: echo 'point 3'; } ?>