ID:               45163
 Updated by:       [EMAIL PROTECTED]
 Reported By:      waps at pisem dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Win Vista x32 Business
 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.

See http://www.php.net/operators.comparison

0 == 'string'

The right hand side is cast to an integer, in this case the right hand
side ends up as 0.


Previous Comments:
------------------------------------------------------------------------

[2008-06-13 19:17:14] waps at pisem dot net

<?php
$strCode = 0;
switch( $strCode )              
{
        case 'jpg':
        case 'jpeg':
                echo 'point 0';
                break;
        case 'gif':
                echo 'point 1';
                break;
        default:
                echo 'point 3';
}
?>

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

[2008-06-13 19:12:20] waps at pisem dot net

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';
}

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

[2008-06-13 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

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

[2008-06-05 18:10:11] [EMAIL PROTECTED]

Please provide a script that has some possibility to work, logically
too. A proper reproducing script starts with <?php and ends with ?>, is
no longer than 20 lines and is self-contained in every way.

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

[2008-06-04 05:36:31] 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"


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


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

Reply via email to