1--TEST--
2pcntl_signal_get_handler()
3--SKIPIF--
4<?php if (!extension_loaded("pcntl")) print "skip"; ?>
5<?php if (!extension_loaded("posix")) die("skip posix extension not available"); ?>
6--FILE--
7<?php
8var_dump(pcntl_signal_get_handler(SIGUSR1));
9
10function pcntl_test($signo) {}
11pcntl_signal(SIGUSR1, 'pcntl_test');
12var_dump(pcntl_signal_get_handler(SIGUSR1));
13
14pcntl_signal(SIGUSR1, SIG_DFL);
15var_dump(pcntl_signal_get_handler(SIGUSR1));
16
17pcntl_signal(SIGUSR1, SIG_IGN);
18var_dump(pcntl_signal_get_handler(SIGUSR1));
19
20posix_kill(posix_getpid(), SIGUSR1);
21pcntl_signal_dispatch();
22
23echo "ok\n";
24?>
25--EXPECT--
26int(0)
27string(10) "pcntl_test"
28int(0)
29int(1)
30ok
31