(PECL pthreads < 3.0.0)
Thread::globally — 执锟斤拷
pthreads v3 锟斤拷锟斤拷锟狡筹拷锟剿凤拷锟斤拷锟斤拷
锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷
锟斤拷锟斤拷锟矫达拷锟斤拷锟侥凤拷锟斤拷值
Example #1 锟斤拷全锟街凤拷围执锟叫达拷锟斤拷锟�
<?php
class My extends Thread {
public function run() {
global $std;
Thread::globally(function(){
$std = new stdClass;
});
var_dump($std);
}
}
$my = new My();
$my->start();
?>
锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�
object(stdClass)#3 (0) { }