From 8262c06d5f424363a68eb086a92171de9bf727c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Andr=C3=A9=20dos=20Santos=20Lopes?= Date: Sat, 19 Nov 2011 17:36:18 +0000 Subject: [PATCH] Documentation for SplObjectStorage::getHash(). git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@319549 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/spl/splobjectstorage/gethash.xml | 68 ++++++++++++++++++++-- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/reference/spl/splobjectstorage/gethash.xml b/reference/spl/splobjectstorage/gethash.xml index bb73b661af..3be25f0fac 100644 --- a/reference/spl/splobjectstorage/gethash.xml +++ b/reference/spl/splobjectstorage/gethash.xml @@ -4,7 +4,9 @@ SplObjectStorage::getHash - Returns the hash of an object + + Calculate an unique identifier for the contained objects + @@ -14,10 +16,20 @@ stringobject - + The function calculates an identifier for the objects added to this + SplObjectStorage object. + + + The implementation in SplObjectStorage returns + the same value as spl_object_hash. + + + This identifer must unique among the objects contained. This means this + object will never contain more than one object with the same identifier. + As such, it can be used to implement a set (a collection of unique values) + where the quality of an object being unique is determined by the value + returned by this function being unique. - - &warn.undocumented.func; @@ -28,7 +40,7 @@ object - + The object whose identifier is to be calculated. @@ -38,10 +50,54 @@ &reftitle.returnvalues; - + A string with the calculated identifier. An exception is + thrown if any other type is returned. + + &reftitle.examples; + + + <function>SplObjectStorage::getHash</function> example + + +]]> + + &example.outputs.similar; + + + + + +