#39531 [NEW]: soft evaluation between integers and strings
| From: | jakobsg at gmail dot com | Date: | Thu, 16 Nov 2006 11:08:28 +0000 |
| Subject: | #39531 [NEW]: soft evaluation between integers and strings | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-105070@lists.php.net to get a copy of this message | ||
From: jakobsg at gmail dot com
Operating system: All
PHP version: 4.4.4
PHP Bug Type: Variables related
Bug description: soft evaluation between integers and strings
Description:
------------
This is pretty straight forward.
The soft evaluation (==) feature in php can be nice, personally I never
use it, but I acknowledge that it can be useful in some situations.
The result of the following evaluation however is not acceptable by any
means (even in soft evaluation):
0 == '0' (true, and acceptable)
0 == 'o' (true, really!!!)
0 == 'o' are equal ... Common - this can only lead to errors.
Best regards Jakob Simon-Gaarde
Reproduce code:
---------------
var_export(0=='o');
Expected result:
----------------
false
Actual result:
--------------
true
--
Edit bug report at http://bugs.php.net/?id=39531&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39531&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39531&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39531&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39531&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=39531&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39531&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39531&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39531&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39531&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39531&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=39531&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=39531&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39531&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39531&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39531&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39531&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39531&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39531&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39531&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39531&r=mysqlcfg