- spl_object_hash: documentation ( source)
<?php
$objects = array();
for ($i=0; $i<10; $i++) {
$foo = new stdClass();
$foo->id = $i;
$objectHash = spl_object_hash($foo);
echo $objectHash . "\n";
$objects[$objectHash] = $foo;
}
echo count($objects);