Not quite. It creates a hash of an object, so two objects with the same data yield the same hashes:

var_dump(spl_object_hash(new stdClass()), spl_object_hash(new stdClass()));

here's the code of spl_object_hash:


        len = spprintf(&hash, 0, "%p:%d", Z_OBJ_HT_P(obj), Z_OBJ_HANDLE_P(obj));
        
        md5str[0] = '\0';
        PHP_MD5Init(&context);
        PHP_MD5Update(&context, (unsigned char*)hash, len);
        PHP_MD5Final(digest, &context);
        make_digest(md5str, digest);
        RETVAL_STRING(md5str, 1);

See any mention of object data? It's not there.

--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to