Re: Subject: diference between == and ===

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx>
To: <php-db@xxxxxxxxxxxxx>
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 ?!

-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux