| @@ 3399-3406 (lines=8) @@ | ||
| 3396 | * @return static |
|
| 3397 | * <p>(Immutable)</p> |
|
| 3398 | */ |
|
| 3399 | public function removeFirst(): self |
|
| 3400 | { |
|
| 3401 | $tmpArray = $this->getArray(); |
|
| 3402 | ||
| 3403 | \array_shift($tmpArray); |
|
| 3404 | ||
| 3405 | return static::create( |
|
| 3406 | $tmpArray, |
|
| 3407 | $this->iteratorClass, |
|
| 3408 | false |
|
| 3409 | ); |
|
| @@ 3418-3425 (lines=8) @@ | ||
| 3415 | * @return static |
|
| 3416 | * <p>(Immutable)</p> |
|
| 3417 | */ |
|
| 3418 | public function removeLast(): self |
|
| 3419 | { |
|
| 3420 | $tmpArray = $this->getArray(); |
|
| 3421 | ||
| 3422 | \array_pop($tmpArray); |
|
| 3423 | ||
| 3424 | return static::create( |
|
| 3425 | $tmpArray, |
|
| 3426 | $this->iteratorClass, |
|
| 3427 | false |
|
| 3428 | ); |
|
| @@ 3612-3621 (lines=10) @@ | ||
| 3609 | * @return static |
|
| 3610 | * <p>(Immutable)</p> |
|
| 3611 | */ |
|
| 3612 | public function rest(int $from = 1): self |
|
| 3613 | { |
|
| 3614 | $tmpArray = $this->getArray(); |
|
| 3615 | ||
| 3616 | return static::create( |
|
| 3617 | \array_splice($tmpArray, $from), |
|
| 3618 | $this->iteratorClass, |
|
| 3619 | false |
|
| 3620 | ); |
|
| 3621 | } |
|
| 3622 | ||
| 3623 | /** |
|
| 3624 | * Return the array in the reverse order. |
|