@@ 3759-3772 (lines=14) @@ | ||
3756 | * @return bool |
|
3757 | * <p>Returns true if associative, false otherwise.</p> |
|
3758 | */ |
|
3759 | public function isAssoc(bool $recursive = false): bool |
|
3760 | { |
|
3761 | if ($this->isEmpty()) { |
|
3762 | return false; |
|
3763 | } |
|
3764 | ||
3765 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
3766 | foreach ($this->keys($recursive)->getGeneratorByReference() as &$key) { |
|
3767 | if ((string) $key !== $key) { |
|
3768 | return false; |
|
3769 | } |
|
3770 | } |
|
3771 | ||
3772 | return true; |
|
3773 | } |
|
3774 | ||
3775 | /** |
|
@@ 3847-3860 (lines=14) @@ | ||
3844 | * @return bool |
|
3845 | * <p>Returns true if numeric, false otherwise.</p> |
|
3846 | */ |
|
3847 | public function isNumeric(): bool |
|
3848 | { |
|
3849 | if ($this->isEmpty()) { |
|
3850 | return false; |
|
3851 | } |
|
3852 | ||
3853 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
3854 | foreach ($this->keys()->getGeneratorByReference() as &$key) { |
|
3855 | if ((int) $key !== $key) { |
|
3856 | return false; |
|
3857 | } |
|
3858 | } |
|
3859 | ||
3860 | return true; |
|
3861 | } |
|
3862 | ||
3863 | /** |