@@ 1806-1822 (lines=17) @@ | ||
1803 | * @return static |
|
1804 | * <p>(Immutable)</p> |
|
1805 | */ |
|
1806 | public function firstsImmutable(int $number = null): self |
|
1807 | { |
|
1808 | $arrayTmp = $this->getArray(); |
|
1809 | ||
1810 | if ($number === null) { |
|
1811 | $array = (array) \array_shift($arrayTmp); |
|
1812 | } else { |
|
1813 | $number = (int) $number; |
|
1814 | $array = \array_splice($arrayTmp, 0, $number); |
|
1815 | } |
|
1816 | ||
1817 | return static::create( |
|
1818 | $array, |
|
1819 | $this->iteratorClass, |
|
1820 | false |
|
1821 | ); |
|
1822 | } |
|
1823 | ||
1824 | /** |
|
1825 | * Get the first value(s) from the current array. |
|
@@ 1833-1849 (lines=17) @@ | ||
1830 | * @return static |
|
1831 | * <p>(Immutable)</p> |
|
1832 | */ |
|
1833 | public function firstsKeys(int $number = null): self |
|
1834 | { |
|
1835 | $arrayTmp = $this->keys()->getArray(); |
|
1836 | ||
1837 | if ($number === null) { |
|
1838 | $array = (array) \array_shift($arrayTmp); |
|
1839 | } else { |
|
1840 | $number = (int) $number; |
|
1841 | $array = \array_splice($arrayTmp, 0, $number); |
|
1842 | } |
|
1843 | ||
1844 | return static::create( |
|
1845 | $array, |
|
1846 | $this->iteratorClass, |
|
1847 | false |
|
1848 | ); |
|
1849 | } |
|
1850 | ||
1851 | /** |
|
1852 | * Get and rmove the first value(s) from the current array. |