| @@ 3293-3306 (lines=14) @@ | ||
| 3290 | * @return bool |
|
| 3291 | * <p>Returns true if associative, false otherwise.</p> |
|
| 3292 | */ |
|
| 3293 | public function isAssoc(bool $recursive = false): bool |
|
| 3294 | { |
|
| 3295 | if ($this->isEmpty()) { |
|
| 3296 | return false; |
|
| 3297 | } |
|
| 3298 | ||
| 3299 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3300 | foreach ($this->keys($recursive)->getGeneratorByReference() as &$key) { |
|
| 3301 | if ((string) $key !== $key) { |
|
| 3302 | return false; |
|
| 3303 | } |
|
| 3304 | } |
|
| 3305 | ||
| 3306 | return true; |
|
| 3307 | } |
|
| 3308 | ||
| 3309 | /** |
|
| @@ 3371-3384 (lines=14) @@ | ||
| 3368 | * @return bool |
|
| 3369 | * <p>Returns true if numeric, false otherwise.</p> |
|
| 3370 | */ |
|
| 3371 | public function isNumeric(): bool |
|
| 3372 | { |
|
| 3373 | if ($this->isEmpty()) { |
|
| 3374 | return false; |
|
| 3375 | } |
|
| 3376 | ||
| 3377 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3378 | foreach ($this->keys()->getGeneratorByReference() as &$key) { |
|
| 3379 | if ((int) $key !== $key) { |
|
| 3380 | return false; |
|
| 3381 | } |
|
| 3382 | } |
|
| 3383 | ||
| 3384 | return true; |
|
| 3385 | } |
|
| 3386 | ||
| 3387 | /** |
|