public function toArray() { $arr = []; while (!$this->isEmpty()) { $arr[] = $this->shift(); } return $arr; }