go to bug id or search bugs for
array_reduce is slow when $carry is very large array and return it with some modification.
My test script is test_array_reduce.php at https://gist.github.com/crhg/45c1f73ca59c9b0f6274412019b19fca
I replaced array_reduce with simple pure php implementation, it runs fast.
Script of this case is test_my_reduce.php.
Add a Patch
Add a Pull Request
This still exists in php 7.2.9.
It's been almost a year, and there's even a PR, can we get a move on with the fix?
Since PR #2931 conflicted with changes to fix #76778, I updated it.
Automatic comment on behalf of email@example.com
Log: Fix bug #75533: array_reduce is slow when $carry is large array