<?php
# 错误全局变量导入
$tester=true;
function tester(){
global $tester;
var_dump($tester);
}
tester(); // 输出 -> bool(true)
class test extends Thread{
public function run(){
global $tester;
tester(); // 输出 -> NULL
}
}
$workers=new test();
$workers->start();
?>