From: tihon at netcbc dot com
Operating system: Windows
PHP version: 5.1.2
PHP Bug Type: Scripting Engine problem
Bug description: Great bug with "for(){}" cycle on Windows based servers
Description:
------------
Well, when i was using two operators "for()" and one of them was included
into another like "for(){for(){}}". I had noticed they at Windows internal
variables of these two operators are not intersected. You will see the
sense of my words further in example.
Reproduce code:
---------------
for($i=$start_point;$i<count($videos);$i++)
{
$video = $videos[$i];
$langs_html = '';
$lang_ids = unserialize($video->LanguageId);
foreach($lang_ids as $lang_id)
{
$lang = new Lang;
$lang->Id = $lang_id;
$lang->init();
$langs_html .= '<td width="50" align="center"><img
src="./index_files/checkmark.gif"></td>';
}
for($i=0;$i<(count($langs)-count($lang_ids));$i++)
{
$langs_html .= '<td width="50" align="center"> </td>';
}
}
Expected result:
----------------
I was expected to get an array divided into two HTML tables. I have pasted
not full code to you. But if you try to use even this example of my code
you will see, that $i variable of outer operator "for()" does not
conflicts with variable $i of inner operator "for()". Just try to output
the value of $i and you will see that it remains unchaged within outer
operator.
But at Unix version of PHP that was happening (PHP Version 4.3.9).
Actual result:
--------------
Read in expected result section. Everything was described there.
--
Edit bug report at http://bugs.php.net/?id=36270&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36270&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36270&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36270&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36270&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36270&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36270&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36270&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36270&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36270&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36270&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36270&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36270&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36270&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36270&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36270&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36270&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36270&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36270&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36270&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36270&r=mysqlcfg