(No version information available, might only be in Git)
QuickHashStringIntHash::loadFromString — This factory method creates a hash from a string
public static QuickHashStringIntHash::loadFromString ( string $contents [, int $size = 0 [, int $options = 0 ]] ) : QuickHashStringIntHash
This factory method creates a new hash from a definition in a string. The format is the same as the one used in "loadFromFile".
contents
The string containing a serialized format of the hash.
size
The amount of bucket lists to configure. The number you pass in will be automatically rounded up to the next power of two. It is also automatically limited from 4 to 4194304.
options
The same options that the class' constructor takes; except that the size option is ignored. It is automatically calculated to be the same as the number of entries in the hash, rounded up to the nearest power of two with a maximum limit of 4194304.
Returns a new QuickHashStringIntHash.
Example #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"; } ?>
The above example will output something similar to:
© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/quickhashstringinthash.loadfromstring.php