Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

pcntl_signal_dispatch

Description

The pcntl_signal_dispatch of PCNTL for PHP calls signal handlers for pending signals.

Syntax

pcntl_signal_dispatch(): bool

Return

Returns true on success or false on failure.

Examples

1 · void

<?

function handler($signo, $siginfo)
{
    print_r($siginfo);
}

$signal = SIGHUP;
$handler = "handler";

pcntl_signal($signal, $handler);

$process_id = posix_getpid();

posix_kill($process_id, $signal);

$return = pcntl_signal_dispatch();

var_export($return);

?>
Array
(
    [signo] => 1
    [errno] => 0
    [code] => 0
)
true
HomeMenu