|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-02-03 06:42 UTC] tony2001@php.net
[2006-02-11 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 13:00:01 2025 UTC |
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.