dicomresearch/priority-array

v0.1.1 2015-07-28 10:16 UTC

This package is not auto-updated.

Last update: 2024-09-18 10:17:14 UTC


README

允许存储带优先级的元素,就像 SPLPriorityQueue 一样,并且像 Queue 一样根据优先级返回元素。但是,与 SPLPriorityQueue 不同的是,它不会在访问元素时删除它们。

如何使用

安装

php composer.phar require dicomresearch/priority-array

使用

$array = new PriorityArray();
$array->append($value, $priority);

foreach ($array as $element) {
    echo $element;
}