: in short, it is necessary to use strict comparisons and no steam%). - camryn27 commented on July 9th 19 at 11:16
: not always better) I memorized the signs on the principle: "codici PHP first recite a comparison of types and regex" ))
need it constantly. - Kyleigh_Hills commented on July 9th 19 at 11:19
:
>>> what horror. (false=='wtf') // false. It is essentially the same as (0=='wtf'). Go cry in the bushes
absolutely NOT THE SAME thing and the bushes should go then, if you fail to understand how type casting in PHP
(false=='wtf') here to perform the comparison operation blaze will result to Boolean type the string "wtf", that is, converts it to TRUE, because it is not empty
(0=='wtf') - here, the string is converted to the number. Read about type conversion again. So for example if you passed the string "1wtf", you would get the comparison 0 == 1 and it would have been FALSE - Arielle commented on July 9th 19 at 11:22
Please sign in or sign up to write your answer or comment.
var_dump(0 == "a"); // 0 == 0 -> true
- Kyleigh_Hills commented on July 9th 19 at 11:07need it constantly. - Kyleigh_Hills commented on July 9th 19 at 11:19
>>> what horror. (false=='wtf') // false. It is essentially the same as (0=='wtf'). Go cry in the bushes
absolutely NOT THE SAME thing and the bushes should go then, if you fail to understand how type casting in PHP
(false=='wtf') here to perform the comparison operation blaze will result to Boolean type the string "wtf", that is, converts it to TRUE, because it is not empty
(0=='wtf') - here, the string is converted to the number. Read about type conversion again. So for example if you passed the string "1wtf", you would get the comparison 0 == 1 and it would have been FALSE - Arielle commented on July 9th 19 at 11:22