PHP's own queue class: SplQueue

Code
<?php

// FIFO by default
$list = new SplQueue();

try {
    
// unlike SplDoublyLinkedList you can't change direction
    
$list->setIteratorMode(SplStack::IT_MODE_LIFO);
}
catch(
RuntimeException $e) {
    echo 
$e->getMessage() . PHP_EOL;
}

// you can change KEEP to DELETE, unlike SplStack
$list->setIteratorMode(SplStack::IT_MODE_DELETE);


// adding elements with enqueue (alias of push) or unshift
$list->enqueue(1);
$list->enqueue(10);
$list->enqueue(100);

foreach (
$list as $element) {
    echo 
$element PHP_EOL;
}

echo 
'count: ' count($list);
Result
Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen
1
10
100
count: 0
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8