Is there a way to execute internal functions in parallel in PHP?
For example, I have four functions:
function a(){
return 1;
}
function b(){
return 2;
}
function c(){
return 3;
}
function d(){
return 4;
}
When I call these functions sequentially like this:
function E(){
$response = [] ;
$response['a'] = a();
$response['b'] = b();
$response['c'] = c();
$response['d'] = d();
}
They execute in sequential order. However, I want to call them in parallel. Is there any way to achieve this in PHP?
I tried with AMP and swoole php but not worked
Swoole can do this. Does not work is not a proper description.
Mutliple corotuines created with go are executed concurrently.
learn more https://openswoole.com/docs/modules/swoole-coroutine-create