<?php
    
class Country {
        var 
$area;
        function 
Country($area) {
            
$this->area $area;
        }
    }
    
$deutschland = new Country('West Europe');
    
$die_schweiz = new Country('West Europe');

    if (
$deutschland == $die_schweiz)
        echo 
"Deutschland ist die Schweiz.\n";
    if (
$deutschland === $die_schweiz)
        echo 
"Deutschland ist die Schweiz.\n";
?>

In PHP 4 $obj1 ==(=) $obj2 result in true when the object's properties are the same



In PHP 5 $obj1 == $obj2 results in true when the object's properties are the same

In PHP 5 $obj1 === $obj2 results in true when the object's handles are the same