getmypid

(PHP 4, PHP 5, PHP 7, PHP 8)

getmypid获取 PHP 进程的 ID

说明

getmypid(): int|false

获取当前 PHP 进程 ID。

参数

此函数没有参数。

返回值

返回当前 PHP 进程 ID,或在错误时返回 false

注释

警告

进程 ID 并不是唯一的,所以他们是一个弱熵源。 对安全性有依赖的上下文中我们不推荐依赖于 pid。

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top