What is the use of "===" operator??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the use of "===" operator???

Explain

1st Jun 2018, 1:26 PM
Meet Soni
Meet Soni - avatar
5 Answers
+ 5
=== checks if both the variables have same value and same data type.
1st Jun 2018, 2:13 PM
Mitali
Mitali - avatar
+ 3
As with most other languages, the === operator is used to test if one variable is identical to another, testing both its value and data type. It will only return true if both variables have the same value and data type
1st Jun 2018, 1:34 PM
Faisal
Faisal - avatar
+ 3
Returns true if $x is equal to $y, and they are of the same type <?php $x = 10;   $y = "10"; var_dump($x === $y); // returns false because types are not equal ?>  
1st Jun 2018, 1:36 PM
MsJ
MsJ - avatar
+ 1
It help to avoid some problems with == , and !== too
1st Jun 2018, 2:38 PM
Ahmed Hosny
Ahmed Hosny - avatar
0
Surely equal sign
1st Jun 2018, 9:52 PM
Kwanele Msizazwe
Kwanele Msizazwe - avatar