PHP Functions
A php function is a block of code that can be called multiple times within your program to perform some sort of task. PHP has over 1000 built-in functions but you can also create your own custom ones to suit your needs. A function can take a variety of inputs including variables, parameters and objects and return a properly formatted array of output.
pcntl_signal_get_handler() installs a new signal handler or replaces the existing one for the signal indicated by the signal name. The handler can be either a callable that will be invoked to handle the signal, or either of the global constants SIG_IGN or SIG_DFL which ignore the signal or restore the default signal handler respectively. In addition the signal handler will be passed a second argument which contains the siginfo of that particular signal. This data is only supplied if the operating system supports the siginfo_t structure otherwise NULL will be provided.
If you are creating child processes for your application and don't want them to become zombies on exit then the best way to stop them is by sending a SIGKILL signal. You can do this on the shell by typing kill -9 PID. Alternatively you can use a pcntl_waitpid() on them which will allow them to complete their work and exit for real allowing your main process to die without leaving zombies behind. pcntl_waitpid() is good at wait()ing on children asynchronously so you do not have to worry about the children killing your main process or stealing its memory.