what does === mean in php?

Posted on 2007-09-28
Last Modified: 2012-05-05
hi guys, can you tell me what the differnece between == and === in php is?

Question by:djsoltan
    LVL 13

    Accepted Solution

    It's a strong test of equality. Unlike == which tests if two values are the same, === also tests whether the types being compared are the same.

    Hence, a statement such as

    will evaluate true if $var = 1, whereas

    will evaluate false if $var = 1
    LVL 28

    Expert Comment

    $a === $b Identical TRUE if $a is equal to $b, and they are of the same type. (introduced in PHP 4)  

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    A colleague recently asked me about how to give his client a small part of the web site that could be completely under the client's control.  Since I have done this sort of thing before to add emergency banners to a web site, I decided I would creat…
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now