| @@ 3590-3597 (lines=8) @@ | ||
| 3587 | * @return static |
|
| 3588 | * <p>(Immutable)</p> |
|
| 3589 | */ |
|
| 3590 | public function removeFirst(): self |
|
| 3591 | { |
|
| 3592 | $tmpArray = $this->getArray(); |
|
| 3593 | ||
| 3594 | \array_shift($tmpArray); |
|
| 3595 | ||
| 3596 | return static::create( |
|
| 3597 | $tmpArray, |
|
| 3598 | $this->iteratorClass, |
|
| 3599 | false |
|
| 3600 | ); |
|
| @@ 3609-3616 (lines=8) @@ | ||
| 3606 | * @return static |
|
| 3607 | * <p>(Immutable)</p> |
|
| 3608 | */ |
|
| 3609 | public function removeLast(): self |
|
| 3610 | { |
|
| 3611 | $tmpArray = $this->getArray(); |
|
| 3612 | ||
| 3613 | \array_pop($tmpArray); |
|
| 3614 | ||
| 3615 | return static::create( |
|
| 3616 | $tmpArray, |
|
| 3617 | $this->iteratorClass, |
|
| 3618 | false |
|
| 3619 | ); |
|
| @@ 3801-3810 (lines=10) @@ | ||
| 3798 | * @return static |
|
| 3799 | * <p>(Immutable)</p> |
|
| 3800 | */ |
|
| 3801 | public function rest(int $from = 1): self |
|
| 3802 | { |
|
| 3803 | $tmpArray = $this->getArray(); |
|
| 3804 | ||
| 3805 | return static::create( |
|
| 3806 | \array_splice($tmpArray, $from), |
|
| 3807 | $this->iteratorClass, |
|
| 3808 | false |
|
| 3809 | ); |
|
| 3810 | } |
|
| 3811 | ||
| 3812 | /** |
|
| 3813 | * Return the array in the reverse order. |
|