public function pop()
    {
        $value = $this->stack[$this->current];

        unset($this->stack[$this->current]);

        --$this->current;

        if ($this->current < 0) {
            $this->reset();
        }

        return $value;
    }