Skip to content

Commit 3bf47c7

Browse files
committed
Added SPL Queue example
1 parent cef4362 commit 3bf47c7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

chap-04/SplQueue.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: bert
5+
* Date: 3/10/18
6+
* Time: 22:39
7+
*/
8+
9+
$agents = new SplQueue();
10+
11+
$agents->enqueue("Fred");
12+
$agents->enqueue("John");
13+
$agents->enqueue("Keith");
14+
$agents->enqueue("Adiyan");
15+
$agents->enqueue("Michael");
16+
17+
echo $agents->dequeue() . PHP_EOL;
18+
echo $agents->dequeue() . PHP_EOL;
19+
echo $agents->bottom() . PHP_EOL;

0 commit comments

Comments
 (0)