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