"When using the comparison operator (==), object variables are compared in a simple manner, namely: Two object instances are equal if they have the same attributes and values, and are instances of the same class."
Actually, it doesn't matter if they have different values:
<?php
/* ... */
$o = new Flag();
$p = new Flag(10);
/* ... */
echo "Two instances of the same class\n";
compareObjects($o, $p);
?>
output:
Two instances of the same class
o1 == o2 : TRUE
o1 != o2 : FALSE
o1 === o2 : FALSE
o1 !== o2 : TRUE
Jony dos Santos Kostetzer