php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #62799 Parallel array processing
Submitted: 2012-08-11 19:50 UTC Modified: 2021-02-26 18:02 UTC
Votes:4
Avg. Score:4.0 ± 1.7
Reproduced:3 of 4 (75.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: info at ludwig-gramberg dot de Assigned:
Status: Suspended Package: Arrays related
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: info at ludwig-gramberg dot de
New email:
PHP Version: OS:

 

 [2012-08-11 19:50 UTC] info at ludwig-gramberg dot de
Description:
------------
Idea: an easy to use parallel processing function for arrays (or any iterable 
data structure).

Example:

<?php
$arr = array(1, 2, 3, 4);
array_process_parallel($arr, function($a) { return $a+5; });
?>

Now $arr would contain the following: [6, 7, 8, 9].
The values are written back to $arr. The parameter is called by reference.

Also a array_parallel_reduce would be nice.

Test script:
---------------
$arr = array(1, 2, 3, 4);
array_process_parallel($arr, function($a) { return $a+5; });

Expected result:
----------------
[6, 7, 8, 9]


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-12 13:01 UTC] laruence@php.net
do you mean something like array_map?  
http://us2.php.net/manual/en/function.array-walk.php
 [2012-08-12 13:01 UTC] laruence@php.net
s ,array_map,array_walk,  :)
 [2012-08-12 18:38 UTC] info at ludwig-gramberg dot de
yes, array_walk, map and so on could all be done in parallel, which would be very 
interesting speedwise
 [2021-02-26 18:02 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2021-02-26 18:02 UTC] cmb@php.net
This is unlikely to happen for NTS builds.  For ZTS builds you can
use the parallel extension[1] to build such functions in userland.

Anyhow, if you want to see this feature in php-src, please pursue
the RFC process[2].  For the time being, I'm suspending this
ticket.

[1] <http://pecl.php.net/parallel>
[2] <https://wiki.php.net/rfc/howto>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 15:01:30 2025 UTC