note 36975 deleted from language.types.type-juggling by didou
| From: | didou@php.net | Date: | Wed, 29 Oct 2003 14:25:45 +0000 |
| Subject: | note 36975 deleted from language.types.type-juggling by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59473@lists.php.net to get a copy of this message | ||
Note Submitter: emilebosch@hotmail.com
----
Just a little something that got me stuck for a amazing 5 minutes..
According to PHP this is the same..
---------------
if("1.15"=="1.150") echo "Look me being buggy!";
---------------
It does output the "Look me being buggy!" code!
What happends is that php sees the dot (.) for a number so it typecasts the TEXT to a FLOAT before
matching the values. Even still its not the same but it does give the same amount.
Anyway, if you use a triple === it doesnt echo anything this is because the value and the TYPE have
to be required to give a TRUE back.
---------------
if("1.15"==="1.150") echo "Look me being buggy!";
---------------
So this doesn't give anything back .. Another problem solved!