#23394 [Fbk->NoF]: wrong with reset()

From: Date: Fri, 09 May 2003 12:42:22 +0000
Subject: #23394 [Fbk->NoF]: wrong with reset()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39381@lists.php.net to get a copy of this message
ID: 23394 Updated by: sniper@php.net Reported By: tmgh at www dot deyang dot gov dot cn -Status: Feedback +Status: No Feedback Bug Type: Output Control Operating System: win2000 server PHP Version: 4.3.2RC2 New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. Previous Comments: ------------------------------------------------------------------------ [2003-04-29 01:20:18] derick@php.net Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. ------------------------------------------------------------------------ [2003-04-28 21:36:58] tmgh at www dot deyang dot gov dot cn 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. ------------------------------------------------------------------------ [2003-04-28 21:23:46] 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? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23394&edit=1

« previous php.bugs (#39381) next »