phasync
Queue / tryPeek

Method

Queue::tryPeek

Copies the first value of the queue into $value, without removing it, and returns whether there was one.

Description#

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

Parameters#

$value mixed
Receives the value

Return values#

False if the queue was empty bool

See also#

  • Queue::tryDequeueTakes the first value off the queue into $value, and returns whether there was one.