ID:               39579
 Updated by:       [EMAIL PROTECTED]
 Reported By:      iain at workingsoftware dot com dot au
-Status:           Open
+Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: FreeBSD 6.1
 PHP Version:      5.2.0
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.


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

[2006-11-22 07:31:34] iain at workingsoftware dot com dot au

Description:
------------
if you have a variable with the value 0 assigned to it and do a
comparison with a non-integer then the non-integer value is cast to an
int with unexpected results. it behaves differently when comparing a
non-zero integer.

Reproduce code:
---------------
put this in test.php and run php -f test.php:

<?php
$zero = 0;
$one = 1;

if($zero == 'SOME STRING')
    echo("0 does equal 'SOME STRING'\n");
else
    echo("0 does not equal 'SOME STRING'\n");

if($one == 'SOME STRING')
    echo("1 does equal 'SOME STRING'\n");
else
    echo("1 does not equal 'SOME STRING'\n");
?>

Expected result:
----------------
0 does not equal 'SOME STRING'
1 does not equal 'SOME STRING'

Actual result:
--------------
0 does equal 'SOME STRING'
1 does not equal 'SOME STRING'


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


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

Reply via email to