| @@ 3298-3311 (lines=14) @@ | ||
| 3295 | * @return bool |
|
| 3296 | * <p>Returns true if associative, false otherwise.</p> |
|
| 3297 | */ |
|
| 3298 | public function isAssoc(bool $recursive = false): bool |
|
| 3299 | { |
|
| 3300 | if ($this->isEmpty()) { |
|
| 3301 | return false; |
|
| 3302 | } |
|
| 3303 | ||
| 3304 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3305 | foreach ($this->keys($recursive)->getGeneratorByReference() as &$key) { |
|
| 3306 | if ((string) $key !== $key) { |
|
| 3307 | return false; |
|
| 3308 | } |
|
| 3309 | } |
|
| 3310 | ||
| 3311 | return true; |
|
| 3312 | } |
|
| 3313 | ||
| 3314 | /** |
|
| @@ 3376-3389 (lines=14) @@ | ||
| 3373 | * @return bool |
|
| 3374 | * <p>Returns true if numeric, false otherwise.</p> |
|
| 3375 | */ |
|
| 3376 | public function isNumeric(): bool |
|
| 3377 | { |
|
| 3378 | if ($this->isEmpty()) { |
|
| 3379 | return false; |
|
| 3380 | } |
|
| 3381 | ||
| 3382 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3383 | foreach ($this->keys()->getGeneratorByReference() as &$key) { |
|
| 3384 | if ((int) $key !== $key) { |
|
| 3385 | return false; |
|
| 3386 | } |
|
| 3387 | } |
|
| 3388 | ||
| 3389 | return true; |
|
| 3390 | } |
|
| 3391 | ||
| 3392 | /** |
|