[deleted]
In Perl, you can assign a sub routine to one of the $SIG{...}'s, fork a child process, set an alarm to timeout the process in the child, if the process (e.g., some commands inside backticks) worked within the "timeout" limit, alarm(0)is called and the %SIG is not prompted. If the command(s) inside the backticks takes too long, "alarm" will go off and prompt the $SIG{...} to call the sub routine, which probably kills the child process and give a flag...
- Is there a similar process in PHP? if yes, how?
- Does PHP support the %SIG?
Related Perl functions:
alarm( timeout )
fork()
waitpid( pid, flag)