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; + + + + + +