SPL-StandardPHPLibrary
splqueue.inc
Go to the documentation of this file.
1 <?php
2 
26 {
27  protected $_it_mode = parent::IT_MODE_FIFO;
28 
42  public function setIteratorMode($mode)
43  {
44  if ($mode & parent::IT_MODE_LIFO === parent::IT_MODE_LIFO) {
45  throw new RuntimeException("Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen");
46  }
47 
48  $this->_it_mode = $mode;
49  }
50 
55  public function dequeue()
56  {
57  return parent::shift();
58  }
59 
65  public function enqueue($data)
66  {
67  return parent::push($data);
68  }
69 }
70 
71 ?>
enqueue($data)
Pushes an element at the end of the queue.
Definition: splqueue.inc:65
Doubly Linked List.
setIteratorMode($mode)
Changes the iteration mode.
Definition: splqueue.inc:42
dequeue()
Definition: splqueue.inc:55
Exception thrown for errors that are only detectable at runtime.
Definition: spl.php:423
Implementation of a Queue through a DoublyLinkedList.
Definition: splqueue.inc:25