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?
=== operator
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 10, 2011, 8:21 PM EST
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.
Akash AhlawatRank #3,915 · 379 reputationPosted Nov 11, 2011, 1:58 AM EST