Thread::globally

(PECL pthreads < 3.0.0)

Thread::globally执锟斤拷

Warning

pthreads v3 锟斤拷锟斤拷锟狡筹拷锟剿凤拷锟斤拷锟斤拷

说锟斤拷

public static Thread::globally ( void ) : mixed

锟斤拷全锟街凤拷围锟斤拷执锟叫达拷锟斤拷锟�

锟斤拷锟斤拷

锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟斤拷锟斤拷锟矫达拷锟斤拷锟侥凤拷锟斤拷值

锟斤拷锟斤拷

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) {
}