The Queue::pop()
function in PHP returns the element that is available at the front of the queue, and removes that element from the queue.
Figure 1 shows the visual representation of the Queue::pop()
function.
queue_name->pop()
## where the queue_name is the name of the queue
This function does not require a parameter.
This function returns the element
that is available at the front of the queue and removes that element
from the queue.
<?php$queue = new \Ds\Queue();#sending the list of elements$queue->push(1,3,5,2,0);echo("Queue before pop");print_r($queue);######output#######Queue before pop : 1->3->5->2->0echo("Queue after pop");$queue->pop()print_r($queue);######output#######Queue after pop : 3->5->2->0?>