note 92455 modified in function.pcntl-signal by danbrown
| From: | danbrown@php.net | Date: | Fri, 24 Jul 2009 20:26:08 +0000 |
| Subject: | note 92455 modified in function.pcntl-signal by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-158707@lists.php.net to get a copy of this message | ||
Since php >= 5.3 handles Closures, you are now able to define the Callback directly.
Try this:
<?php
declare(ticks = 1);
pcntl_signal(SIGUSR1, function ($signal) {
echo 'HANDLE SIGNAL ' . $signal . PHP_EOL;
});
posix_kill(posix_getpid(), SIGUSR1);
die;
?>
--was--
Since php >= 5.3 handles Closures, you are now able to define the Callback directly.
Try this:
<?php
declare(ticks = 1);
pcntl_signal(SIGUSR1, function ($signal) {
echo 'HANDLE SIGNAL ' . $signal . PHP_EOL;
});
posix_kill(posix_getpid(), SIGUSR1);
die;
http://php.net/manual/en/function.pcntl-signal.php