请问代码报错原因

WBOY
Release: 2016-06-13 11:55:36
Original
990 people have browsed it

请教代码报错原因

<?php<br /><br />class test{<br />	public $start;<br />	public $end;<br />	public $arr=array();<br />	public function add(){	<br />		foreach(range($start,$end) as $v){<br />			echo $v;<br />		}<br />	}<br />}<br />$test1=new test();<br />$test1->start=1;<br />$test1->end=100;<br />$test1->add();<br /><br />?>
Copy after login

这段代码为什么会报错呢?
------解决方案--------------------
第8 行应为
foreach(range($this->start,$this->end) as $v){

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template