Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PriorityQueue capacity bug #78

Closed
breath-co2 opened this issue Mar 22, 2017 · 1 comment
Closed

PriorityQueue capacity bug #78

breath-co2 opened this issue Mar 22, 2017 · 1 comment

Comments

@breath-co2
Copy link

test on ds 1.1.5, php 7.1.2

<?php
$queue = new \Ds\PriorityQueue();
$queue->push('first', 0);
for ($i = 0; $i < 10; $i ++) {
    $queue->pop();
    $queue->push('i-'.$i, $i);
    var_dump($queue->capacity());
}
$queue->push('end', 0);
print_r($queue);
var_dump($queue->capacity());
echo "done\n";

output:

int(4)
int(2)
int(1)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
int(0)
Ds\PriorityQueue Object
(
    [0] => i-9
    [1] => end
)
int(0)
done
@rtheunissen
Copy link
Member

Fixed and released as 1.1.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants