@@ 3779-3792 (lines=14) @@ | ||
3776 | * @return bool |
|
3777 | * <p>Returns true if associative, false otherwise.</p> |
|
3778 | */ |
|
3779 | public function isAssoc(bool $recursive = false): bool |
|
3780 | { |
|
3781 | if ($this->isEmpty()) { |
|
3782 | return false; |
|
3783 | } |
|
3784 | ||
3785 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
3786 | foreach ($this->keys($recursive)->getGeneratorByReference() as &$key) { |
|
3787 | if ((string) $key !== $key) { |
|
3788 | return false; |
|
3789 | } |
|
3790 | } |
|
3791 | ||
3792 | return true; |
|
3793 | } |
|
3794 | ||
3795 | /** |
|
@@ 3867-3880 (lines=14) @@ | ||
3864 | * @return bool |
|
3865 | * <p>Returns true if numeric, false otherwise.</p> |
|
3866 | */ |
|
3867 | public function isNumeric(): bool |
|
3868 | { |
|
3869 | if ($this->isEmpty()) { |
|
3870 | return false; |
|
3871 | } |
|
3872 | ||
3873 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
3874 | foreach ($this->keys()->getGeneratorByReference() as &$key) { |
|
3875 | if ((int) $key !== $key) { |
|
3876 | return false; |
|
3877 | } |
|
3878 | } |
|
3879 | ||
3880 | return true; |
|
3881 | } |
|
3882 | ||
3883 | /** |