Skip to content

[ext/standard] Move min/max array fallback into array.c#22147

Open
mehmetcansahin wants to merge 1 commit into
php:masterfrom
mehmetcansahin:minmax-move-fallback-to-array
Open

[ext/standard] Move min/max array fallback into array.c#22147
mehmetcansahin wants to merge 1 commit into
php:masterfrom
mehmetcansahin:minmax-move-fallback-to-array

Conversation

@mehmetcansahin
Copy link
Copy Markdown
Contributor

@mehmetcansahin mehmetcansahin commented May 25, 2026

Follow-up to @Girgias' review on #22127: this splits out the behavior-preserving baseline refactor before the numeric min()/max() fast path work.

Split out from #22127 as the behavior-preserving baseline refactor requested during review.

This moves the generic min()/max() array fallback out of the Zend HashTable API and into ext/standard/array.c, where it is the only remaining user. The local helper uses the regular ZEND_HASH_FOREACH_VAL() API and calls zend_compare() directly, avoiding the previous function-pointer wrapper.

UPGRADING.INTERNALS is updated to document that zend_hash_minmax() is no longer exposed.

Compatibility check: Sourcegraph search only found stale vendored/documentation copies plus one old PHP 7.x extension (viest/php-ext-collection) using this internal symbol. The removal is documented in UPGRADING.INTERNALS.

Tested with:

  • make -j"$(sysctl -n hw.ncpu)"
  • sapi/cli/php run-tests.php -q ext/standard/tests/array/min*.phpt ext/standard/tests/array/max*.phpt

@Girgias Girgias requested a review from TimWolla May 25, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants