26 $this->output = array();
33 if (empty($this->output)) {
34 $this->output = array_reverse($this->
input);
35 $this->
input = array();
37 if (empty($this->output)) {
40 return array_pop($this->output);
54 return empty($this->
input) && empty($this->output);
push($x)
Pushes an element onto the front of the queue.
A simple array-backed queue, based off of the classic Okasaki persistent amortized queue...
isEmpty()
Checks if it's empty.
__construct($input=array())
shift()
Shifts an element off the front of the queue.