In the first case:
null==0
null evaluates to false , the same as 0 , which evaluates to false , so both are false , and therefore the comparison returns true .
In the second case:
0=="0"
here you are comparing two variables of different types, one is a digit and the other is a string, because you do not use === , PHP passed one of them to another type, therefore 0 , cast to a string is "0" , therefore they are the same if they " 0 " , which is added to the number, also adds to 0 , so its value matches another value, and therefore this comparison returns true.
In the third case:
null=="0"
here the same situation, both are different types, so PHP applies one of them to the type of the other, but if you pass null to a string, the result is "null" that is not equal to "0" , so the reason is not what a comparison.
source share