| @@ 3607-3620 (lines=14) @@ | ||
| 3604 | * @return bool |
|
| 3605 | * <p>Returns true if associative, false otherwise.</p> |
|
| 3606 | */ |
|
| 3607 | public function isAssoc(bool $recursive = false): bool |
|
| 3608 | { |
|
| 3609 | if ($this->isEmpty()) { |
|
| 3610 | return false; |
|
| 3611 | } |
|
| 3612 | ||
| 3613 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3614 | foreach ($this->keys($recursive)->getGeneratorByReference() as &$key) { |
|
| 3615 | if ((string) $key !== $key) { |
|
| 3616 | return false; |
|
| 3617 | } |
|
| 3618 | } |
|
| 3619 | ||
| 3620 | return true; |
|
| 3621 | } |
|
| 3622 | ||
| 3623 | /** |
|
| @@ 3695-3708 (lines=14) @@ | ||
| 3692 | * @return bool |
|
| 3693 | * <p>Returns true if numeric, false otherwise.</p> |
|
| 3694 | */ |
|
| 3695 | public function isNumeric(): bool |
|
| 3696 | { |
|
| 3697 | if ($this->isEmpty()) { |
|
| 3698 | return false; |
|
| 3699 | } |
|
| 3700 | ||
| 3701 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3702 | foreach ($this->keys()->getGeneratorByReference() as &$key) { |
|
| 3703 | if ((int) $key !== $key) { |
|
| 3704 | return false; |
|
| 3705 | } |
|
| 3706 | } |
|
| 3707 | ||
| 3708 | return true; |
|
| 3709 | } |
|
| 3710 | ||
| 3711 | /** |
|