After iteration, the queue will be empty. Therefore, `count()` will return 0. You can circumvent this by iterating over a clone, instead of the actual queue.
https://stackoverflow.com/questions/27464012/splpriorityqueuenext-is-removing-the-item