#29515 [Opn->Fbk]: While cycle error

From: Date: Wed, 04 Aug 2004 05:56:16 +0000
Subject: #29515 [Opn->Fbk]: While cycle error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-64060@lists.php.net to get a copy of this message
 ID:               29515
 Updated by:       derick@php.net
 Reported By:      borivoje at gmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Scripting Engine problem
 Operating System: Windows XP
 PHP Version:      4.3.8
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.


Previous Comments:
------------------------------------------------------------------------

[2004-08-04 02:12:32] borivoje at gmail dot com

Description:
------------
http://www.code-experts.com/listTopic.asp?tid=44

Reproduce code:
---------------
    echo $poss . ' -  positions<br/>';

    $paragraphs = explode("\n",$textToReplace);
	$ord = 0;
    
	while (list($breakIndex,$breakToReplace) = each($paragraphs)) {
	  echo $poss . "<br/>"; // <------    here
	  echo $breakIndex . "-" . $ord . "<br/>";
	  if ($breakIndex % $poss = 0) {
		$ord = $ord + 1;
		if ($ord = 1) $paragraphs[$breakIndex] = "<p class='news_preview'>".
$breakToReplace . "<img class='news_pic_r'
src='$picDir/$article->picturePath1'/></p>";
		if ($ord = 2) $paragraphs[$breakIndex] = "<p class='news_preview'>".
$breakToReplace . "<img class='news_pic_l'
src='$picDir/$article->picturePath2'/></p>";
		if ($ord = 3) $paragraphs[$breakIndex] = "<p class='news_preview'>".
$breakToReplace . "<img class='news_pic_r'
src='$picDir/$article->picturePath3'/></p>";
	  } else {
	    $paragraphs[$breakIndex] = "<p class=\"news_preview\">".
$breakToReplace ."</p>";
	  }     
	}


Expected result:
----------------
All ones (1 int)

Actual result:
--------------
First one then 0-oes


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=29515&edit=1


Thread (6 messages)

« previous php.bugs (#64060) next »