#31049 [Opn]: FOR loop = infinite looping
| From: | francois at b-powers dot be | Date: | Sat, 11 Dec 2004 00:09:23 +0000 |
| Subject: | #31049 [Opn]: FOR loop = infinite looping | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-70037@lists.php.net to get a copy of this message | ||
ID: 31049
User updated by: francois at b-powers dot be
Reported By: francois at b-powers dot be
Status: Open
Bug Type: Unknown/Other Function
Operating System: Red Hat Linux release 9 (Shrike)
PHP Version: 4.3.9
New Comment:
Hello,
Finally we find out an issue in our php.ini
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.5.3
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.5.3
;zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
Well it seems to be a bug or bogus, we don't know why that extension
(we just uncommented) of Zend would create that kind of endless loops.
We are just happy that is solved, if it's really bug could you tell us
?
Thanks for your support,
For B-Powers,
Francois
Previous Comments:
------------------------------------------------------------------------
[2004-12-10 11:17:14] francois at b-powers dot be
Same kind of issue of this link: http://bugs.php.net/bug.php?id=30307
but here i have Php 4.3.9, how did you fix it ?
Thanks,
Francois
------------------------------------------------------------------------
[2004-12-10 07:44:27] francois at b-powers dot be
One strange thing that i learned by testing if, i put $link++; instead
if $link=$link+1; it's working why ?
Or even if i put $i<= (12+0), is it a string problem ?
By the way my FOR loops are working in a small test.php page but in my
big php page (47kb) public.php
Thanks,
Francois
------------------------------------------------------------------------
[2004-12-10 03:16:10] francois at b-powers dot be
Description:
------------
Hello,
I have a user who just moved to my server and the script was working
fine on Php 4.3.9 loaded as a CGI. Now, we are on Apache with php
loaded as a module. Here is our phpinfo:
http://www.b-powers.be/phpinfo.php
The problem is about FOR loops. Indeed, for some reasons, it's going to
an endless looping even if the code is right.
Hoping someone will be able to help us,
We tried to fix it since 3 days.
Francois
Ps; this script is made of a lot of files using FOR loops so we are
looking for a fix in this memory problem or bug, so we won't need to
edit all files. THANKS A LOT.
Reproduce code:
---------------
<select name="month" id="month" style="BACKGROUND-COLOR: <?php echo
$body_fond['valeur']; ?>;"
onChange="MM_jumpMenu('parent',this,0)">
<?
for ($i = 1; $i <= 12; $i++) {
$link = $i+1;
IF($_GET['month'] == $link){
$selected = "selected";
} ELSE {
$selected = "";
}
echo "<option
value=\"public.php?espace=$_GET[espace]&testi=$i&month=$link&langue=$langue&year=$_GET[year]\"
$selected>" . traduc($langue,date ("F",
mktime(0,0,0,$i,1,$_GET['year']))) . "</option>\n";
}
/* IF I DO REPLACE IT WITH A WHILE IT WILL WORK ...
$i=1;
while ($i <= 12)
{
$link = $i+1;
IF($_GET['month'] == $link)
$selected = "selected";
} ELSE {
$selected = "";
}
echo "<option
value=\"public.php?espace=$_GET[espace]&month=$link&langue=$langue&year=$_GET[year]\"
$selected>" . traduc($langue,date ("F",
mktime(0,0,0,$i,1,$_GET['year']))) . "</option>\n";
$i++;
}
*/
?>
</select>
Expected result:
----------------
showing in a scrollbox, the 12 months
Actual result:
--------------
endless loop
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31049&edit=1