(PECL pthreads >= 2.0.0)
Thread::getThreadId — 識別
返回引用線程的ID
此函數(shù)沒有參數(shù)。
線程ID,數(shù)字格式
示例 #1 返回引用線程的ID
<?php
class My extends Thread {
public function run() {
printf("%s is Thread #%lu\n", __CLASS__, $this->getThreadId());
}
}
$my = new My();
$my->start();
?>
以上例程會輸出:
My is Thread #123456778899