| @@ 3581-3588 (lines=8) @@ | ||
| 3578 | * @return static |
|
| 3579 | * <p>(Immutable)</p> |
|
| 3580 | */ |
|
| 3581 | public function removeFirst(): self |
|
| 3582 | { |
|
| 3583 | $tmpArray = $this->getArray(); |
|
| 3584 | ||
| 3585 | \array_shift($tmpArray); |
|
| 3586 | ||
| 3587 | return static::create( |
|
| 3588 | $tmpArray, |
|
| 3589 | $this->iteratorClass, |
|
| 3590 | false |
|
| 3591 | ); |
|
| @@ 3600-3607 (lines=8) @@ | ||
| 3597 | * @return static |
|
| 3598 | * <p>(Immutable)</p> |
|
| 3599 | */ |
|
| 3600 | public function removeLast(): self |
|
| 3601 | { |
|
| 3602 | $tmpArray = $this->getArray(); |
|
| 3603 | ||
| 3604 | \array_pop($tmpArray); |
|
| 3605 | ||
| 3606 | return static::create( |
|
| 3607 | $tmpArray, |
|
| 3608 | $this->iteratorClass, |
|
| 3609 | false |
|
| 3610 | ); |
|
| @@ 3792-3801 (lines=10) @@ | ||
| 3789 | * @return static |
|
| 3790 | * <p>(Immutable)</p> |
|
| 3791 | */ |
|
| 3792 | public function rest(int $from = 1): self |
|
| 3793 | { |
|
| 3794 | $tmpArray = $this->getArray(); |
|
| 3795 | ||
| 3796 | return static::create( |
|
| 3797 | \array_splice($tmpArray, $from), |
|
| 3798 | $this->iteratorClass, |
|
| 3799 | false |
|
| 3800 | ); |
|
| 3801 | } |
|
| 3802 | ||
| 3803 | /** |
|
| 3804 | * Return the array in the reverse order. |
|