You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
378 B
30 lines
378 B
8 years ago
|
<?php
|
||
|
|
||
|
namespace Coffee;
|
||
|
|
||
|
/**
|
||
|
* Class Queue
|
||
|
*
|
||
|
* @package Coffee
|
||
|
*/
|
||
|
class Queue {
|
||
|
|
||
|
/**
|
||
|
* @var array
|
||
|
*/
|
||
|
private $queue = [];
|
||
|
|
||
|
/**
|
||
|
* @param $element
|
||
|
*/
|
||
|
public function push($element) {
|
||
|
$this->queue[] = $element;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return mixed
|
||
|
*/
|
||
|
public function pop() {
|
||
|
return array_shift($this->queue);
|
||
|
}
|
||
|
}
|