php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36270 Great bug with "for(){}" cycle on Windows based servers
Submitted: 2006-02-03 01:51 UTC Modified: 2006-02-11 01:00 UTC
From: tihon at netcbc dot com Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5.1.2 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tihon at netcbc dot com
New email:
PHP Version: OS:

 

 [2006-02-03 01:51 UTC] tihon at netcbc dot com
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">&nbsp;</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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-03 06:42 UTC] tony2001@php.net
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 to avoid embedding huge scripts into the report.


 [2006-02-11 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 09:01:32 2024 UTC