﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	focuses
65467	Avoid over-allocation in wp_is_numeric_array()	dmsnell		"When a trace of allocations revealed that `wp_is_numeric_array()` accounted for a significant fraction of the allocations in a page render, it was observed that the function eagerly allocates and copies array keys and then filters them when all it wants to know is whether a single key in the array meets a condition.

This may not have a meaningful impact on performance overall, but it may account for a significant part of the process when parsing `theme.json` files and removing the allocations and discarded computation is an easy win when this alternative is not meaningfully more complicated than the original code.

----

Since PHP 8.1 the function `array_is_list()` is available as well. It performs the probably-intended check that `wp_is_numeric_array()` performs in practically constant and instant time, also with zero allocation.

There is a subtle difference in behavior, however, in that PHP considers an array a list //only// if its keys start at zero and increase monotonically. WordPress considers an array numeric if the keys are all numeric keys. It was probably not intentional to draw this distinction, and it’s likely that the impact of a breaking change to defer to the faster built-in PHP function is minimal and worth the change.

----

This was discovered and discussed and patched during WCEU 2026 Contributor Day."	enhancement	new	normal	7.1	General	4.4	normal		has-patch		performance
