update : 2015.11.03
php.shukuma.com검색:
|
SplObjectStorage::getHash(PHP 5 >= 5.4.0) SplObjectStorage::getHash — Calculate a unique identifier for the contained objects 설명
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. 인수
반환값A string with the calculated identifier. 오류/예외A RuntimeException is thrown when the returned value is not a string. 예제
Example #1 SplObjectStorage::getHash() example
<?php 위 예제의 출력 예시: 2 3 |