| @@ 3353-3366 (lines=14) @@ | ||
| 3350 | * @return bool |
|
| 3351 | * <p>Returns true if associative, false otherwise.</p> |
|
| 3352 | */ |
|
| 3353 | public function isAssoc(bool $recursive = false): bool |
|
| 3354 | { |
|
| 3355 | if ($this->isEmpty()) { |
|
| 3356 | return false; |
|
| 3357 | } |
|
| 3358 | ||
| 3359 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3360 | foreach ($this->keys($recursive)->getGeneratorByReference() as &$key) { |
|
| 3361 | if ((string) $key !== $key) { |
|
| 3362 | return false; |
|
| 3363 | } |
|
| 3364 | } |
|
| 3365 | ||
| 3366 | return true; |
|
| 3367 | } |
|
| 3368 | ||
| 3369 | /** |
|
| @@ 3431-3444 (lines=14) @@ | ||
| 3428 | * @return bool |
|
| 3429 | * <p>Returns true if numeric, false otherwise.</p> |
|
| 3430 | */ |
|
| 3431 | public function isNumeric(): bool |
|
| 3432 | { |
|
| 3433 | if ($this->isEmpty()) { |
|
| 3434 | return false; |
|
| 3435 | } |
|
| 3436 | ||
| 3437 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3438 | foreach ($this->keys()->getGeneratorByReference() as &$key) { |
|
| 3439 | if ((int) $key !== $key) { |
|
| 3440 | return false; |
|
| 3441 | } |
|
| 3442 | } |
|
| 3443 | ||
| 3444 | return true; |
|
| 3445 | } |
|
| 3446 | ||
| 3447 | /** |
|