#29515 [Opn->Fbk]: While cycle error
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)