class test{ public $start; public $end; public $arr=array(); public function add(){ foreach(range($start,$end) as $v){ echo $v; } } } $test1=new test(); $test1->start=1; $test1->end=100; $test1->add();
?>
这段代码为什么会报错呢? ------解决方案-------------------- 第8 行应为 foreach(range($this->start,$this->end) as $v){