(No version information available, might only be in Git)
QuickHashStringIntHash::loadFromString — This factory method creates a hash from a string
$contents, int $size = 0, int $options = 0): QuickHashStringIntHashThis factory method creates a new hash from a definition in a string. The format is the same as the one used in "loadFromFile".
contentssizeoptionsReturns a new QuickHashStringIntHash.
例1 QuickHashStringIntHash::loadFromString() example
<?php
$contents = file_get_contents( dirname( __FILE__ ) . "/simple.hash.string" );
$hash = QuickHashStringIntHash::loadFromString(
$contents,
QuickHashStringIntHash::DO_NOT_USE_ZEND_ALLOC
);
foreach( range( 0, 0x0f ) as $key )
{
$i = 48712 + $key * 1631;
$k = base_convert( $i, 10, 36 );
echo $k, ' => ', $hash->get( $k ), "\n";
}
?>上の例の出力は、 たとえば以下のようになります。
11l4 => 48712 12uf => 50343 143q => 51974 15d1 => 53605 16mc => 55236 17vn => 56867 194y => 58498 1ae9 => 60129 1bnk => 61760 1cwv => 63391 1e66 => 65022 1ffh => 66653 1gos => 68284 1hy3 => 69915 1j7e => 71546 1kgp => 73177