+ 1

Please explain

If(0==='abc' ) { Echo 'true'; } Help

6th Oct 2020, 5:30 PM
ĂŠshrĂźth.htm
ĂŠshrĂźth.htm - avatar
2 Answers
+ 6
If 0 is of the same value and type as abc then it will echo true, if not it will show no output. So, it shows no output as 0 is not of the same value and type as abc.
6th Oct 2020, 5:39 PM
Pranav
Pranav - avatar
+ 2
=== is used for strict comparison. meaning the data type and value has to be the same for it to be true. in the example it strictly compares 0 which is (int) to 'abc' which is (string) so it's false, neither the data type nor the value are equal. it prints nothing. //Echo has to be echo.
6th Oct 2020, 5:42 PM
Bahha┣
Bahha┣ - avatar