4
I have a script with several functions.
I would like to set one timeout (guy set_time_limit
) specific to a function, and if time runs out, it "disregards" and continues running the loop/script.
Example:
function teste(){
sleep(10);
}
foreach($array as $v) {
echo $v;
teste();
}
Taking the example, the function teste()
will run for 10 seconds at each loop.
So want to set a timeout 3 seconds to function, and in the event of "bursting" time, he dismisses, and continues the loop.
- Is there such a possibility?
The Reactphp library provides ways to implement this functionality. With specific PHP functions, I believe you will not get this behavior. Reactphp
– Rodrigo Vaz