(Available since version 1.0)
Queue::__construct — Constructs a new queue implemented using a singly linked list
This constructs a new empty queue.
This function has no parameters.
No value is returned.
Example #1 Queue::__construct() example
<?php
require 'vendor/autoload.php'; // A PSR-4 or PSR-0 autoloader
use SEIDS\LinkedLists\Singly\Queue;
$q = new Queue();
$q[] = 1;
$q[] = 2;
$q[] = 3;
foreach ($q as $elem) {
echo $elem."\n";
}
?>
The above example will output:
1 2 3