append($item); } } /** * @param mixed $mItem */ public function append($mItem, bool $bToTop = false) : void { if ($bToTop) { $array = $this->getArrayCopy(); array_unshift($array, $mItem); $this->exchangeArray($array); } else { parent::append($mItem); } } public function Add($mItem, bool $bToTop = false) : self { $this->append($mItem, $bToTop); return $this; } public function Clear() : void { $this->exchangeArray([]); } public function Slice(int $offset, int $length = null, bool $preserve_keys = false) { return new static( array_slice($this->getArrayCopy(), $offset, $length, $preserve_keys) ); } public function Crop(int $length = null, int $offset = 0, bool $preserve_keys = false) { $this->exchangeArray( array_slice($this->getArrayCopy(), $offset, $length, $preserve_keys) ); return $this; } }