如果运算符不同,则运算符==在两种不同类型之间进行转换,而===运算符执行“类型安全比较”。这意味着如果两个操作数具有相同的类型和相同的值,它将仅返回true。例子:1 === 1: true1 == 1: true1 === "1": false // 1 is an integer, "1" is a string1 == "1": true // "1" gets casted to an integer, which is 1"foo" === "foo": true // both operands are strings and have the same value警告:具有等效成员的同一类的两个实例与===运算符不匹配。例:$a = new stdClass();$a->foo = "bar";$b = clone $a;var_dump($a === $b); // bool(false)