Skip to content

Conversation

IanDelMar
Copy link
Contributor

An empty array is considered a numeric array. Since PHPStan 2.1.23, this is accounted for, so inside if (! wp_is_numeric_array($data)) PHPStan correctly infers $data as a non-empty-array: an empty array would make wp_is_numeric_array($data) return true and therefore cannot reach the negated branch.

Related:

@szepeviktor szepeviktor merged commit 1a46f0d into php-stubs:master Sep 10, 2025
7 checks passed
@IanDelMar IanDelMar deleted the wp_is_numeric_array branch September 10, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants