Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
$a === $b //TRUE если $a равно $b и имеет тот же тип.
The difference between != and !==, as well as == and ===, is the strictness of the comparison.
For example
$a = 1;
$b = "1";
$a == $b will return TRUE, since types are cast to a common one, respectively, != in this situation will return FALSE,
and $a === $b will return FALSE, since data types will also be compared.
This is a rough explanation, but the principle of operation should be clear.
Если кратко (только часто встречающиеся в повседневной практике):
=== для СТРОГОЙ проверки ТИПА и ЗНАЧЕНИЯ.
Пример: (1==='1' || 0===false) => false || false => false
== для НЕСТРОГОЙ проверки СТРОК/ЦИФР (печатных символов) с автоприведением типов.
Пример: (1=='1' && 0==false) => true && true => true
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question