|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #78700 support posix strsignal(int signo)
Submitted: 2019-10-20 09:56 UTC Modified: 2019-10-20 10:54 UTC
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: divinity76+spam at gmail dot com Assigned:
Status: Open Package: PCNTL related
PHP Version: Next Minor Version OS: POSIX
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-10-20 09:56 UTC] divinity76+spam at gmail dot com
Posix has a function called strsignal(), since at least POSIX.1-2008, docs can be found here 

but the TL;DR is that it converts a signal to it's signal name (like in Linux, signal 15 is SIGTERM, and it converts int(15) to string("SIGTERM"))

would be nice if the posix extension could add support for it.

a naive-ish userland implementation can be found at
 (i don't know if the userland implementation is error-free, and it does not use the posix strsignal() function, but at least it appears to work)

Test script:


Expected result:
string(7) "SIGTERM"

Actual result:
PHP Fatal error:  Uncaught Error: Call to undefined function posix_strsignal() in /foo.php:3
Stack trace:
#0 {main}
  thrown in /jail/home/foo.php on line 3


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-20 10:54 UTC]
-Package: POSIX related +Package: PCNTL related
 [2019-10-20 10:54 UTC]
It should probably go with the pcntl functions, since it's related to signal handling.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Nov 28 04:05:55 2022 UTC