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
()));
Folks, is this really wanted behavior? Because if so, why does the
following result in the same hash as well(PHP-5.2.1)?
$ php -r "class Foo{};$foo = new
Foo();var_dump(spl_object_hash($foo));$foo->bar =
1;var_dump(spl_object_hash($foo));"
string(32) "d1f40a1cc04d8c79d09ae6262666adbb"
string(32) "d1f40a1cc04d8c79d09ae6262666adbb"
- David
--
Best regards, Pavel
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php