From:             ken at smallboxsoftware dot net
Operating system: ALL
PHP version:      5.2.5
PHP Bug Type:     Feature/Change Request
Bug description:  Casting During Comparison

Description:
------------
Casting during comparison should only happen if values of different types
are being compared. 

For example: "42" == "+42" should not return true. 

This result is not very intuitive and probably leads to a number of subtle
errors in various scripts. 

Reproduce code:
---------------
<?php

echo "Should Return False:".("400" == "+400")."<BR>";
echo "Should Return False:".((string) "400" == (string) "+400")."<BR>";
echo "Does Return False:".("400" === "+400")."<BR>";

?>


-- 
Edit bug report at http://bugs.php.net/?id=43304&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43304&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43304&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43304&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43304&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43304&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43304&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43304&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43304&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43304&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43304&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43304&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43304&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43304&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43304&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43304&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43304&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43304&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43304&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43304&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43304&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43304&r=mysqlcfg

Reply via email to