quickhash icon indicating copy to clipboard operation
quickhash copied to clipboard

getSize() error

Open breath-co2 opened this issue 9 years ago • 0 comments

<?php
$set = new QuickHashStringIntHash(64);
$count = 10000;
for ($i = 0; $i < $count; $i++)
{
    $set->set("a$i", 1);
}
var_dump($set->getSize());
for ($i = 0; $i < $count; $i++)
{
    //$set["a$i"] = 1;
    if (!$set->exists("a$i"))
    {
        echo "a$i is not exists\n";
    }
}

out:

int(9691)

if change

$set = new QuickHashStringIntHash(64);

to

$set = new QuickHashStringIntHash(65536);

while output:

int(9999)

if change

$set = new QuickHashStringIntHash(65536);

to

$set = new QuickHashStringIntHash(65537);

while output:

int(10000)

my php version is : 7.0.6

breath-co2 avatar Jul 01 '16 04:07 breath-co2