Hướng dẫn compare two object php
When using the comparison operator ( When using the identity operator ( An example will clarify these rules. Example #1 Example of object comparison
compareObjects(&$o1, &$o2) The above example will output: Two instances of the same class o1 == o2 : TRUE o1 != o2 : FALSE o1 === o2 : FALSE o1 !== o2 : TRUE Two references to the same instance o1 == o2 : TRUE o1 != o2 : FALSE o1 === o2 : TRUE o1 !== o2 : FALSE Instances of two different classes o1 == o2 : FALSE o1 != o2 : TRUE o1 === o2 : FALSE o1 !== o2 : TRUE
jazfresh at hotmail.com ¶ 15 years ago
Anonymous ¶ 12 years ago
= new stdClass(); rnealxp at yahoo dot com ¶ 2 years ago
rnealxp at yahoo dot com ¶ 5 years ago
$type1 !== $type2){ nhuhoai ¶ 8 years ago
wbcarts at juno dot com ¶ 14 years ago
__toString() rune at zedeler dot dk ¶ 15 years ago
cross+php at distal dot com ¶ 14 years ago
rune at zedeler dot dk ¶ 15 years ago
Hayley Watson ¶ 13 years ago
"Comparing Leaf object equivalence: is \$leaf1==\$leaf2? ", ($leaf1 == $leaf2 ? "Yes" : "No"), "\n"; Oddant ¶ 9 years ago
|