PHP安装threads多线程扩展基础教程
$out = "GET {$_SERVER['PHP_SELF']}?flag=$i HTTP/1.1rn";
$out .= "Host: {$_SERVER['HTTP_HOST']}rn";
$out .= "Connection: Closernrn";
fputs($fp,$out);
fclose($fp);
}
}
}
}
}
七、测试pthreads扩展
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
include('thread.php');
class AsyncOperation extends Thread {
public function __construct($arg){
$this->arg = $arg;
}
public function run(){
if($this->arg){
printf("Hello %s\n", $this->arg);
}
}
}
$thread = new AsyncOperation("World");
if($thread->start())
$thread->join();
以上内容给大家介绍了PHP安装threads多线程扩展基础教程,希望大家喜欢。
【PHP安装threads多线程扩展基础教程】相关文章: