php is a weakly typed language, but it also has the concept of data type, on the contrary, because PHP is not very strict in the data type, so when learning, often do not pay attention to the use of errors, these errors , many times it appears in the judgment of the data type, ambiguous, disorderly operation caused. The following analysis of common operations:
1, "= =" and "= = =" The difference between
"= =" comparison operator, does not check the type of the expression it would consider an empty string, 0, false is null
"= = =" constant equals, while checking the value and type of an expression Only if the value of one variable is true is NULL, it represents null
<?php//== versus = = = NULL; $STR 2 = $str1 STR3 = 0; $str 4 = "", echo $str 1 = = null? ' Yes<br/> ': ' no<br/> ';//yesecho $str 1 = = = null? ' yes
2, isset () differs from empty ()
3,
PHP Detail Analysis