| @@ 3502-3515 (lines=14) @@ | ||
| 3499 | * @return bool |
|
| 3500 | * <p>Returns true if associative, false otherwise.</p> |
|
| 3501 | */ |
|
| 3502 | public function isAssoc(bool $recursive = false): bool |
|
| 3503 | { |
|
| 3504 | if ($this->isEmpty()) { |
|
| 3505 | return false; |
|
| 3506 | } |
|
| 3507 | ||
| 3508 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3509 | foreach ($this->keys($recursive)->getGeneratorByReference() as &$key) { |
|
| 3510 | if ((string) $key !== $key) { |
|
| 3511 | return false; |
|
| 3512 | } |
|
| 3513 | } |
|
| 3514 | ||
| 3515 | return true; |
|
| 3516 | } |
|
| 3517 | ||
| 3518 | /** |
|
| @@ 3590-3603 (lines=14) @@ | ||
| 3587 | * @return bool |
|
| 3588 | * <p>Returns true if numeric, false otherwise.</p> |
|
| 3589 | */ |
|
| 3590 | public function isNumeric(): bool |
|
| 3591 | { |
|
| 3592 | if ($this->isEmpty()) { |
|
| 3593 | return false; |
|
| 3594 | } |
|
| 3595 | ||
| 3596 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3597 | foreach ($this->keys()->getGeneratorByReference() as &$key) { |
|
| 3598 | if ((int) $key !== $key) { |
|
| 3599 | return false; |
|
| 3600 | } |
|
| 3601 | } |
|
| 3602 | ||
| 3603 | return true; |
|
| 3604 | } |
|
| 3605 | ||
| 3606 | /** |
|