Skip to content

getSize() error  #9

@breath-co2

Description

@breath-co2
<?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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions