|
SplObjectStorage::getHashCalculate a unique identifier for the contained objects Beschreibung
public string SplObjectStorage::getHash
( object
$object
)This method calculates an identifier for the objects added to an SplObjectStorage object. The implementation in SplObjectStorage returns the same value as spl_object_hash. The storage 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. Parameter-Liste
RückgabewerteA string with the calculated identifier. Fehler/ExceptionsA RuntimeException is thrown when the returned value is not a string. Beispiele
Beispiel #1 SplObjectStorage::getHash example
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie: 2 3 Siehe auch
|