Get the current handler for specified signal

# pcntl_signal_get_handler

(PHP 7 >= 7.1.0)

pcntl_signal_get_handler — Get the current handler for specified signal

### 説明

pcntl_signal_get_handler ( int `$signo` ) : mixed

The pcntl_signal_get_handler() function will get the current handler for the specified `signo`.

### パラメータ

`signo`

  The signal number.

### 返り値

This function may return an integer value that refers to `SIG_DFL` or `SIG_IGN`. If you set a custom handler a string value containing the function name is returned.

### 変更履歴

バージョン | 説明
--- | ---
7.1.0 | pcntl_signal_get_handler() has been added.

### 例

例1 pcntl_signal_get_handler() example

`<?php
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: int(0)
function pcntl_test($signo) {}
pcntl_signal(SIGUSR1, 'pcntl_test');
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: string(10) "pcntl_test"
pcntl_signal(SIGUSR1, SIG_DFL);
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: int(0)
pcntl_signal(SIGUSR1, SIG_IGN);
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: int(1)
?>`

### 参考

- pcntl_signal() - シグナルハンドラを設定する