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

    $jurop = new Country;
    $dutchieland = new Country;
    $dutchieland->set_name('The Netherlands');

    echo (int) $jurop, "\n";
    echo (int) $dutchieland, "\n";
?>
output:

Object id #1
Object id #2


In PHP 5 (int) $object results in: