PHPDaemon\Structures\StackCallbacks::executeAndKeepOne PHP Method

executeAndKeepOne() public method

Executes one callback from the top with given arguments without taking it out
public executeAndKeepOne ( $args ) : boolean
$args Arguments
return boolean
    public function executeAndKeepOne(...$args)
    {
        if ($this->isEmpty()) {
            return false;
        }
        $cb = $this->shift();
        $this->unshift($cb);
        if ($cb) {
            $cb(...$args);
        }
        return true;
    }