use Think\Controller;
class RandController extends Controller {
private $rand = -1;
private function setRand($r){
$this->rand = $r;
}
private function getRand(){
return $this->rand;
}
public function index(){
$this->setRand(300);
$this->display();
}
public function check(){
$a = $this->getRand();
var_dump($a);
}
}
程序先执行index,后执行check,为嘛输出是$a=-1,值没变化,不是300呢,求大神指导。。。。
最佳答案
