# [PATCH] allow array_reduce to have a mixed starting value

- Thread: https://externals.io/message/16913
- Original archive: https://news-web.php.net/php.internals/16913
- Started by David Tulloh on 2005-06-26T22:29:08+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #16913 — David Tulloh — 2005-06-26T22:29:08+00:00

URL: https://externals.io/message/16913#16913

I opened bug #33447 the other day which is a feature request to allow
array_reduce to have a mixed starting value.  It currently will only
accept integers which I feel is an odd limitation since the array can
hold any value.

This is a trivial patch to array_reduce which removes this limitation.
All the tests passed with this modification (that passed without it).  I
also included a test file which tests the new functionality and provides
a few examples of what it could be useful for.


David
