php comparison explained

php is an awful language and we all know it. It has a very silly comparison algorithm for loose comparison (==) which I am going to try to explain.

If we compare variables of different types (bool, string, int, float, array, object) with each other, php tries to cast them into a common type. But some types have no „common ground“ and can never under any value assignment, be considered equal. This Venn-Diagram shows you, which stuff can be compared with each other to, in any way, get variables that are considered equal.