From:             [EMAIL PROTECTED]
Operating system: Linux Debian 2.2r2 (testing)
PHP version:      4.0.6
PHP Bug Type:     Strings related
Bug description:  Comparison with zero (0) returns TRUE

When strings are compared to 0, they always return TRUE.

<?php
$test = 'somestring';
if( $test == 'somestring')
echo "Match 1\n";
if( $test == 0 )
echo "Match 2\n";
if( $test == 1 )
echo "Match 3\n";
if( $test != 0 )
echo "Match 4\n";
if( $test != 'somestring' )
echo "Match 5\n";
if( $test != 1 )
echo "Match 6\n";
?>

Expected Output:
Match 1


Actual Ouput:
Match 1
Match 2
Match 6

Is there something I'm missing?

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


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to