Method 'next' deletes node from top. See example:
<?php
$queue = new SplPriorityQueue();
$queue->insert('Q', 5);
$queue->insert('W', 1);
$queue->insert('E', 4);
$queue->insert('R', 2);
$queue->insert('Y', 3);
$queue->next();
$queue->next();
$queue->next();
print_r($queue);
?>
Will be output:
SplPriorityQueue Object
(
[flags:SplPriorityQueue:private] => 1
[isCorrupted:SplPriorityQueue:private] =>
[heap:SplPriorityQueue:private] => Array
(
[0] => Array
(
[data] => R
[priority] => 2
)
[1] => Array
(
[data] => W
[priority] => 1
)
)
)