Ask a Question related to PHP Development, Design and Development.
-
pollita@php.net #1
#25763 [Opn->WFx]: Why the string "1.10" is equal to the string "1.1"?
ID: 25763
Updated by: [email]pollita@php.net[/email]
Reported By: jparneodo at yahoo dot fr
-Status: Open
+Status: Wont fix
Bug Type: Strings related
Operating System: RH7.2
PHP Version: 4.3.3
New Comment:
Answer: Because PHP is a loose-typed lanague.
== will evaluate to TRUE if the two values CAN be shown to be equal
within reason.
Calling 1.1 equal to 1.10 is within reason.
You clearly know about the === comparison type so I won't bother
pointing that out.
Previous Comments:
------------------------------------------------------------------------
[2003-10-06 14:08:02] jparneodo at yahoo dot fr
Description:
------------
I excepted true if one of the compared variable was numeric,
because of type juggling rules (Appendix K. PHP type comparison
tables), but false when the 2
variables are string.
In this case == and === must have the same result.
Reproduce code:
---------------
$a=(string)"1.1";
$b=(string)"1.10";
if($a==$b) echo "equal";
else echo "different";
Expected result:
----------------
different
Actual result:
--------------
equal
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=25763&edit=1[/url]
pollita@php.net Guest
-
#37773 [Asn->Csd]: iconv_substr() gives "Unknown error" when string length = 1"
ID: 37773 Updated by: iliaa@php.net Reported By: dave at dgx dot cz -Status: Assigned +Status: Closed Bug Type: ICONV... -
"Error Creating Control" and "Cast from String"
I'm creating a custom date control. In appearance, it's just a textbox and a button. It has three custom properties: CalDate, CalDateType and... -
#26292 [Opn->Bgs]: substr returns "0" for any offset on the string "0"
ID: 26292 Updated by: sniper@php.net Reported By: ravacholp at hotmail dot com -Status: Open +Status: ... -
#25763 [NEW]: Why the string "1.10" is equal to the string "1.1"?
From: jparneodo at yahoo dot fr Operating system: RH7.2 PHP version: 4.3.3 PHP Bug Type: Strings related Bug description: ... -
convert visual basic "string" data type to DB2 "blob"
Does anyone know if a visual basic string data type can be converted to DB2 blob datatype? I have all data in XML files and I use Visual Basic to...



Reply With Quote

