New course! Every coder should learn Generative AI!
Try a free lesson+ 2
What is the use of "===" operator???
Explain
5 Answers
+ 5
=== checks if both the variables have same value and same data type.
+ 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
+ 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
?>
+ 1
It help to avoid some problems with == , and !== too
0
Surely equal sign