此函数没有参数。
一个 数组,包含队列中所有值,顺序与队列相同。
示例 #1 Ds\PriorityQueue::toArray() 示例
<?php
$queue = new \Ds\PriorityQueue();
$queue->push("a", 5);
$queue->push("b", 15);
$queue->push("c", 10);
var_dump($queue->toArray());
?>以上示例输出类似以下内容
array(3) {
[0]=>
string(1) "b"
[1]=>
string(1) "c"
[2]=>
string(1) "a"
}