2
Answers

=== operator

Photo of Akash Ahlawat

Akash Ahlawat

13y
1.3k
1
In past I have implemented = and == operator..
But recently while reading a book I have seen the use of === operator..
Can anybody tell me about this?

Answers (2)

0
Photo of Pravin More
NA 2.6k 136.1k 13y
Hi Akash,

      

A triple equals operator (===) is a comparison operator and it tests the value (variable, expression or constant) of left to the right for identicalness. The value of left and right have to be equal AND the type has to be equal as well. (i.e. both are strings or both are integers).

$a = 5;
$b = "5?;
if ($a === $b) echo "same"; // Returns FALSE



Thanks
Pravin.
Accepted
1
Photo of Akash Ahlawat
NA 327 128.7k 13y
Thanks Pravin..