Voting

: four plus four?
(Example: nine)

The Note You're Voting On

Aurelien Marchand
7 years ago
To be clear, the phrase "pcntl_signal() doesn't stack the signal handlers, but replaces them. " means that you can still have different functions for different signals but only one function per signal.

In other words, this will work as expected

<?php

pcntl_async_signals
(true);
pcntl_signal(SIGUSR1,function(){echo "received SIGUSR1";});
pcntl_signal(SIGUSR2,function(){echo "received SIGUSR2";});
posix_kill(posix_getpid(),SIGUSR1);
posix_kill(posix_getpid(),SIGUSR2);

// returns "received SIGUSR1" and then "received SIGUSR2"

?>

<< Back to user notes page

To Top