|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75533 array_reduce is slow when $carry is large array
Submitted: 2017-11-16 04:31 UTC Modified: -
Avg. Score:3.3 ± 0.5
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: manabu dot matsui at gmail dot com Assigned:
Status: Closed Package: Performance problem
PHP Version: 7.1.11 OS: macOS 10.13.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
27 - 19 = ?
Subscribe to this entry?

 [2017-11-16 04:31 UTC] manabu dot matsui at gmail dot com
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

I replaced array_reduce with simple pure php implementation, it runs fast.
Script of this case is test_my_reduce.php.


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-09-17 13:46 UTC] martin dot ninov at gmail dot com
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?
 [2018-09-18 05:40 UTC] manabu dot matsui at gmail dot com
Since PR #2931 conflicted with changes to fix #76778, I updated it.
 [2018-09-18 18:52 UTC]
Automatic comment on behalf of
Log: Fix bug #75533: array_reduce is slow when $carry is large array
 [2018-09-18 18:52 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 24 02:01:32 2024 UTC