首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

pcntl_signal_get_handler

(PHP 7.1)

pcntl_signal_get_handler — Get the current handler for specified signal

Description

代码语言:javascript
复制
int|string pcntl_signal_get_handler ( int $signo )

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

Parameters

signo

The signal number.

Return Values

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.

Changelog

Version

Description

Enter the version of change here

Describe the change

Examples

Example #1 pcntl_signal_get_handler() example

代码语言:javascript
复制
<?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)
?>

See Also

  • pcntl_signal() - Installs a signal handler

← pcntl_signal_dispatch

pcntl_signal →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com