|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-04-28 21:23 UTC] tmgh at www dot deyang dot gov dot cn
[client 10.76.1.61] PHP Warning: reset(): Passed variable is not an array or object in f:\website\poll\include\class_poll.php on line 168, referer: http://10.76.1.6/index3.htm [client 10.76.1.61] PHP Warning: key(): Passed variable is not an array or object in f:\website\poll\include\class_poll.php on line 168, referer: http://10.76.1.6/index3.htm what's the wrong?there must be have varies? PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 20 21:00:02 2025 UTC |
the code is here: function get_poll_data($poll_id) { $this->total_votes=0; if (file_exists("$this->include_path/polldata/$poll_id")) { $line = file("$this->include_path/polldata/$poll_id"); if (ereg(".*\\|[0-9]+\\|[0-9]+\\|[0-9]{1}\\|[0-9]{1}\\|[0-9]{1}\\|[0-9]{1}",$line[0])) { list($question,$timestamp,$exp_time,$expire,$logging,$status,$comments) = split("\\|",$line[0]); $this->question = $question; $this->comments = chop($comments); $this->poll_array = ''; $this->color_array = ''; for ($i=1; $i<sizeof($line); $i++) { list($name,$vote,$gif_color) = split("\\|",$line[$i]); $this->poll_array[$name] = $vote; $this->color_array[$name] = chop($gif_color); $this->total_votes += $vote; } for (reset($this->poll_array),$this->maxvote=0; $key=key($this->poll_array); next($this->poll_array)) { $this->maxvote = ($this->poll_array[$key]>$this->maxvote) ? $this->poll_array[$key] : $this->maxvote; } return true; } } else { return false; } } apache2.0.45 report the error line: for (reset($this->poll_array),$this->maxvote=0; $key=key($this->poll_array); next($this->poll_array)) when i use php4.3.1,it's correct.can you tell me how to do?ps,php4.3.2rc2 is faster than php4.3.1,good job.thanks.