<?php
    class Country {
        var $area;
        function Country($area) {
            $this->area = $area;
        }
    }

    $deutschland = new Country('West Europe');
    $die_schweiz = new Country('West Europe');
    $norway      = new Country('Scandinavia');

    if ($deutschland == $die_schweiz) {
        echo "Deutschland ist die Schweiz.\n";
    }
    if ($deutschland === $die_schweiz) {
        echo "Deutschland ist die Schweiz.\n";
    }
    if ($deutschland == $norway) {
        echo "Deutschland er Norway.\n";
    }
?>


In PHP 4 $obj1 == $obj2 or $obj1 === $obj2 results in true: