©
This document uses PHP Chinese website manual Release
(PECL pthreads >= 2.0.0)
Threaded::isTerminated — State Detection
检测是否因致命错误或未捕获的异常而导致执行过程异常终止
此函数没有参数。
布尔值,表示是否异常终止
Example #1 检测对象状态
<?php
class My extends Thread {
public function run () {
i_do_not_exist ();
}
}
$my = new My ();
$my -> start ();
$my -> join ();
var_dump ( $my -> isTerminated ());
?>
以上例程会输出:
bool(true)