PHP 8.5.0 Alpha 1 available for testing

Voting

: min(one, zero)?
(Example: nine)

The Note You're Voting On

Stingus
8 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