| @@ 3626-3639 (lines=14) @@ | ||
| 3623 | * @return bool |
|
| 3624 | * <p>Returns true if associative, false otherwise.</p> |
|
| 3625 | */ |
|
| 3626 | public function isAssoc(bool $recursive = false): bool |
|
| 3627 | { |
|
| 3628 | if ($this->isEmpty()) { |
|
| 3629 | return false; |
|
| 3630 | } |
|
| 3631 | ||
| 3632 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3633 | foreach ($this->keys($recursive)->getGeneratorByReference() as &$key) { |
|
| 3634 | if ((string) $key !== $key) { |
|
| 3635 | return false; |
|
| 3636 | } |
|
| 3637 | } |
|
| 3638 | ||
| 3639 | return true; |
|
| 3640 | } |
|
| 3641 | ||
| 3642 | /** |
|
| @@ 3714-3727 (lines=14) @@ | ||
| 3711 | * @return bool |
|
| 3712 | * <p>Returns true if numeric, false otherwise.</p> |
|
| 3713 | */ |
|
| 3714 | public function isNumeric(): bool |
|
| 3715 | { |
|
| 3716 | if ($this->isEmpty()) { |
|
| 3717 | return false; |
|
| 3718 | } |
|
| 3719 | ||
| 3720 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3721 | foreach ($this->keys()->getGeneratorByReference() as &$key) { |
|
| 3722 | if ((int) $key !== $key) { |
|
| 3723 | return false; |
|
| 3724 | } |
|
| 3725 | } |
|
| 3726 | ||
| 3727 | return true; |
|
| 3728 | } |
|
| 3729 | ||
| 3730 | /** |
|