xref: /php-src/ext/pcntl/tests/async_signals.phpt (revision 74859783)
1--TEST--
2Asynchronous signal handling through VM interrupts
3--EXTENSIONS--
4pcntl
5posix
6--FILE--
7<?php
8pcntl_async_signals(1);
9
10pcntl_signal(SIGTERM, function ($signo) { echo "Signal handler called!\n"; });
11
12echo "Start!\n";
13posix_kill(posix_getpid(), SIGTERM);
14$i = 0; // dummy
15echo "Done!\n";
16
17?>
18--EXPECT--
19Start!
20Signal handler called!
21Done!
22