| @@ 3530-3537 (lines=8) @@ | ||
| 3527 | * @return static |
|
| 3528 | * <p>(Immutable)</p> |
|
| 3529 | */ |
|
| 3530 | public function removeFirst(): self |
|
| 3531 | { |
|
| 3532 | $tmpArray = $this->getArray(); |
|
| 3533 | ||
| 3534 | \array_shift($tmpArray); |
|
| 3535 | ||
| 3536 | return static::create( |
|
| 3537 | $tmpArray, |
|
| 3538 | $this->iteratorClass, |
|
| 3539 | false |
|
| 3540 | ); |
|
| @@ 3549-3556 (lines=8) @@ | ||
| 3546 | * @return static |
|
| 3547 | * <p>(Immutable)</p> |
|
| 3548 | */ |
|
| 3549 | public function removeLast(): self |
|
| 3550 | { |
|
| 3551 | $tmpArray = $this->getArray(); |
|
| 3552 | ||
| 3553 | \array_pop($tmpArray); |
|
| 3554 | ||
| 3555 | return static::create( |
|
| 3556 | $tmpArray, |
|
| 3557 | $this->iteratorClass, |
|
| 3558 | false |
|
| 3559 | ); |
|
| @@ 3743-3752 (lines=10) @@ | ||
| 3740 | * @return static |
|
| 3741 | * <p>(Immutable)</p> |
|
| 3742 | */ |
|
| 3743 | public function rest(int $from = 1): self |
|
| 3744 | { |
|
| 3745 | $tmpArray = $this->getArray(); |
|
| 3746 | ||
| 3747 | return static::create( |
|
| 3748 | \array_splice($tmpArray, $from), |
|
| 3749 | $this->iteratorClass, |
|
| 3750 | false |
|
| 3751 | ); |
|
| 3752 | } |
|
| 3753 | ||
| 3754 | /** |
|
| 3755 | * Return the array in the reverse order. |
|