Voting

: nine minus three?
(Example: nine)

The Note You're Voting On

Stingus ΒΆ
9 years ago
Take care that SplQueue::valid() is not returning true if the queue has nodes. Use isEmpty() instead:

$queue = new SplQueue();
$queue->enqueue('A');
$queue->enqueue('B');
$queue->enqueue('C');
var_dump($queue->valid()); // false
var_dump(!$queue->isEmpty()); // true

<< Back to user notes page

To Top