略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: zend_thread_id

2024-05-05

zend_thread_id

(PHP 5, PHP 7, PHP 8)

zend_thread_id返回当前线程的唯一识别符

说明

zend_thread_id(): int

该函数返回当前线程的唯一识别符。

返回值

以整型(integer)返回线程的 ID。

范例

示例 #1 zend_thread_id() 例子

<?php
$thread_id 
zend_thread_id();

echo 
'Current thread id is: ' $thread_id;
?>

以上例程的输出类似于:

Current thread id is: 7864

注释

注意:

该函数仅在以下情况有效:PHP 内置 ZTS(Zend 线程安全)的支持, 并开启调试模式(--enable-debug)时。

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/function.zend-thread-id.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3