QuickHashStringIntHash::loadFromString

(No version information available, might only be in Git)

QuickHashStringIntHash::loadFromStringThis 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_contentsdirname__FILE__ ) . "/simple.hash.string" );
$hash QuickHashStringIntHash::loadFromString(
    
$contents,
    
QuickHashStringIntHash::DO_NOT_USE_ZEND_ALLOC
);
foreach( 
range00x0f ) as $key )
{
    
$i 48712 $key 1631;
    
$k base_convert$i1036 );
    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

相关文章
php ffi creates a php string from a memory areaphp quickhashinthash this method deletes am entry from the hashphp quickhashinthash this method retrieves a value from the hash by its keyphp quickhashinthash this factory method creates a hash from a filephp quickhashinthash this factory method creates a hash from a stringphp quickhashintset this factory method creates a set from a filephp quickhashintset this factory method creates a set from a stringphp quickhashintstringhash this method deletes am entry from the hashphp quickhashintstringhash this factory method creates a hash from a filephp quickhashintstringhash this factory method creates a hash from a stringphp quickhashstringinthash this method adds a new entry to the hashphp quickhashstringinthash this method deletes am entry from the hashphp quickhashstringinthash this method checks whether a key is part of the hashphp quickhashstringinthash this method retrieves a value from the hash by its keyphp quickhashstringinthash this factory method creates a hash from a filephp quickhashstringinthash this factory method creates a hash from a stringphp quickhashstringinthash this method returns a serialized version of the hashphp quickhashstringinthash this method updates an entry in the hash with a new value or adds a new one if the entry doesn t existphp quickhashstringinthash this method updates an entry in the hash with a new valuephp sdo das xml 函数 creates an xml document object from scratch without the need to load a document from a file or string
关注编程学问公众号