Examples:
Example of object comparison in PHP 5
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.
When using the identity operator (===), object variables are identical if and only if they refer to the same instance of the same class.
An example will clarify these rules.
<?php
function bool2str($bool