note 79205 added to language.operators.comparison
| From: | kenatsmallboxsoftwarenet at osu1 dot php dot net | Date: | Thu, 15 Nov 2007 16:20:36 +0000 |
| Subject: | note 79205 added to language.operators.comparison | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132307@lists.php.net to get a copy of this message | ||
This seems a bit odd to me, but PHP can convert two strings into integers during comparison. For
example: "700" == "+700" return true even though they are totally different
strings.
Use === or strcmp when comparing two strings to ensure that they remain as strings during
comparison.
----
Server IP: 66.207.199.35
Probable Submitter: 24.85.128.200
----
Manual Page -- http://www.php.net/manual/en/language.operators.comparison.php
Edit -- https://master.php.net/note/edit/79205
Del: integrated -- https://master.php.net/note/delete/79205/integrated
Del: useless -- https://master.php.net/note/delete/79205/useless
Del: bad code -- https://master.php.net/note/delete/79205/bad+code
Del: spam -- https://master.php.net/note/delete/79205/spam
Del: non-english -- https://master.php.net/note/delete/79205/non-english
Del: in docs -- https://master.php.net/note/delete/79205/in+docs
Del: other reasons-- https://master.php.net/note/delete/79205
Reject -- https://master.php.net/note/reject/79205
Search -- https://master.php.net/manage/user-notes.php