What happens?:
HtmlForm (includes/htmlform/HtmlForm.php#L432) can lead to PHP memory exhaustion (apparently no matter how high I keep increasing it). This is due to the line:
$this->mFieldTree = array_merge_recursive( $this->mFieldTree, $loadedDescriptor ); array_merge_recursive seems to be highly inefficient in this instance, and it ends up working properly without memory exhaustion or even coming close if I change it to a function such as:
private function mergeArraysRecursive($array1, $array2) { foreach ($array2 as $key => $value) { if (is_array($value) && isset($array1[$key]) && is_array($array1[$key])) { $array1[$key] = $this->mergeArraysRecursive($array1[$key], $value); } else { $array1[$key] = $value; } } return $array1; }
and replace array_merge_recursive with $this->mergeArraysRecursive
Software version: MW 1.40/PHP 8.2.8