#39531 [Bgs]: soft evaluation between integers and strings
| From: | jakobsg at gmail dot com | Date: | Thu, 16 Nov 2006 21:07:15 +0000 |
| Subject: | #39531 [Bgs]: soft evaluation between integers and strings | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-105123@lists.php.net to get a copy of this message | ||
ID: 39531
User updated by: jakobsg at gmail dot com
Reported By: jakobsg at gmail dot com
Status: Bogus
Bug Type: Variables related
Operating System: All
PHP Version: 4.4.4
New Comment:
Is there some where in particular I should look?
It's not here:
http://www.php.net/manual/da/types.comparisons.php
Previous Comments:
------------------------------------------------------------------------
[2006-11-16 11:15:44] tony2001@php.net
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
------------------------------------------------------------------------
[2006-11-16 11:08:28] jakobsg at gmail dot com
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 this bug report at http://bugs.php.net/?id=39531&edit=1