phasync
Queue / tryDequeue

Method

Queue::tryDequeue

Takes the first value off the queue into $value, and returns whether there was one.

Description#

public Queue::tryDequeue(
    mixed &$value
): bool

When the queue is empty, $value is set to null and the result is false.

Parameters#

$value mixed
Receives the value

Return values#

False if the queue was empty bool

See also#

  • Queue::tryPeekCopies the first value of the queue into $value, without removing it, and returns whether there was one.