Skip to content

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

Merged
Girgias merged 1 commit into
php:masterfrom
mehmetcansahin:minmax-move-fallback-to-array
Jun 29, 2026
Merged

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

Conversation

@mehmetcansahin

@mehmetcansahin mehmetcansahin commented May 25, 2026

Copy link
Copy Markdown
Contributor

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
@mehmetcansahin

Copy link
Copy Markdown
Contributor Author

@TimWolla When you have a chance, could you take a look at this one? It has been approved by @Girgias and the checks are green.

This is the behavior-preserving baseline refactor split out before #22127.

@Girgias
Girgias requested a review from arnaud-lb June 28, 2026 12:34
@Girgias
Girgias merged commit 9060fd3 into php:master Jun 29, 2026
19 checks passed
adrian-enspired pushed a commit to adrian-enspired/php-src that referenced this pull request Aug 4, 2026
@mehmetcansahin
mehmetcansahin deleted the minmax-move-fallback-to-array branch August 7, 2026 16:32
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.

4 participants