Re: Subject: diference between == and ===
| From: | Neil Smith [MVP, Digital media] | Date: | Mon, 03 May 2004 17:44:42 +0000 |
| Subject: | Re: Subject: diference between == and === | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-34258@lists.php.net to get a copy of this message | ||
The PHP manual (a useful read btw !) states that === tests for equality and *exact* equivalence, that is:
If you test for ==='1' then $var must be a string for the result to be true
if you test for ===1 then $var must be an integer or double type for the result to be true
Usually its used in tests of $var===0 where you might have a value of Zero (numeric) or False (boolean) and its the only way to tell them apart, as usually Zero also is equivalent to False in PHP.
Cheers - Neil
At 13:16 03/05/2004 +0000, you wrote:
From: "Bruno Braga" <bbraga@neworange.com.pt> To: <php-db@lists.php.net> Date: Mon, 3 May 2004 14:16:29 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative;boundary="----=_NextPart_000_000A_01C43119.3AA76990"Subject: diference between == and === Hi guys.. Wich is the diference between if ($var == '1') or if ($var === '1') == means equality and what does the === means ?!