Index: /trunk/phpgwapi/inc/class.listbox.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.listbox.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.listbox.inc.php	(revision 7673)
@@ -72,5 +72,6 @@
 				$this->p->parse('row','portal_listbox_header',True);
 
-				for ($x = 0; $x < count($this->data); ++$x)
+                $data_count = count($this->data);
+				for ($x = 0; $x < $data_count; ++$x)
 				{
 					$var = Array(
Index: /trunk/phpgwapi/inc/class.resultbox.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.resultbox.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.resultbox.inc.php	(revision 7673)
@@ -54,5 +54,6 @@
 			echo '<table border="0" cellpadding="0" cellspacing="0" width="'.$this->getvar('innerwidth')
 				. '" bgcolor="' . $this->getvar('innerbgcolor') . '">';
-			for ($x = 0; $x < count($this->data); ++$x)
+            $data_count = count($this->data);
+			for ($x = 0; $x < $data_count; ++$x)
 			{
 				echo '<tr>';
Index: /trunk/phpgwapi/inc/class.gdgraph.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.gdgraph.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.gdgraph.inc.php	(revision 7673)
@@ -274,5 +274,6 @@
 			$linespace = ($this->graph_height - $this->margin_top - $this->margin_bottom) / ($this->num_lines_y - 1);
 			$space = 1;
-			for ($i = 0;$i<count($this->data);++$i)
+            $data_count = count($this->data);
+			for ($i = 0;$i<$data_count;++$i)
 			{
 				$y = $this->graph_height - $this->margin_bottom - ($space * $linespace) - 7;
Index: /trunk/phpgwapi/inc/class.contacts_ldap.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.contacts_ldap.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.contacts_ldap.inc.php	(revision 7673)
@@ -328,5 +328,6 @@
 				{
 					$i=0;
-					for($i=0;$i<count($filterarray);++$i)
+                    $filterarray_count = count($filterarray);
+					for($i=0;$i<$filterarray_count;++$i)
 					{
 						list($name,$value) = preg_split('/=/',$filterarray[$i]);
Index: /trunk/phpgwapi/inc/class.log.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.log.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.log.inc.php	(revision 7673)
@@ -92,5 +92,6 @@
 
 			$errorstack = $this->errorstack;
-			for ($i = 0; $i < count($errorstack); ++$i)
+            $errorstack_count = count($errorstack);
+			for ($i = 0; $i < $errorstack_count; ++$i)
 			{
 				$err = $errorstack[$i];
@@ -115,5 +116,6 @@
 			$new = array();
 			reset($this->errorstack);
-			for ($i = 0; $i < count($this->errorstack); ++$i)
+            $errorstack_count = count($this->errorstack);
+			for ($i = 0; $i < $errorstack_count; ++$i)
 			{
 				$err = $this->errorstack[$i];
@@ -141,5 +143,6 @@
 
 			$errorstack = $this->errorstack;
-			for ($i = 0; $i < count($errorstack); ++$i)
+            $errorstack_count = count($errorstack);
+			for ($i = 0; $i < $errorstack_count; ++$i)
 			{
 				$err = $errorstack[$i];
Index: /trunk/phpgwapi/inc/class.errorlog.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.errorlog.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.errorlog.inc.php	(revision 7673)
@@ -124,5 +124,6 @@
 
 			$errorstack = $this->errorstack;
-			for ($i = 0; $i < count($errorstack); ++$i)
+            $errorstack_count = count($errorstack);
+			for ($i = 0; $i < $errorstack_count; ++$i)
 			{
 				$err = $errorstack[$i];
@@ -153,5 +154,6 @@
 			$new = array();
 			reset($this->errorstack);
-			for ($i = 0; $i < count($this->errorstack); ++$i)
+            $errorstack_count = count($this->errorstack);
+			for ($i = 0; $i < $errorstack_count; ++$i)
 			{
 				$err = $this->errorstack[$i];
@@ -182,5 +184,6 @@
 
 			$errorstack = $this->errorstack;
-			for ($i = 0; $i < count($errorstack); ++$i)
+            $errorstack_count = count($errorstack);
+			for ($i = 0; $i < $errorstack_count; ++$i)
 			{
 				$err = $errorstack[$i];
Index: /trunk/phpgwapi/inc/class.vcard.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.vcard.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.vcard.inc.php	(revision 7673)
@@ -624,5 +624,6 @@
 		// Takes an array of contacts class fields/values, turns it into a vcard string:
 		//
-		// for($i=0;$i<count($buffer);++$i)
+        // $buffer_count = count($buffer);
+		// for($i=0;$i<$buffer_count;++$i)
 		// {
 		//     $vcards .= $this->vcard->out($buffer[$i]);
Index: /trunk/phpgwapi/inc/class.setup.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.setup.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.setup.inc.php	(revision 7673)
@@ -302,5 +302,6 @@
 				}
 				$values = explode('.',$value);
-				for($i = 0; $i < count($values); ++$i)
+                $values_count = count($values);
+				for($i = 0; $i < $values_count; ++$i)
 				{
 					if ((int) $values[$i] != (int) $remotes[$i])
@@ -710,5 +711,6 @@
 			$less = 0;
 
-			for($i=0;$i<count($testa);++$i)
+            $testa_count = count($testa);
+			for($i=0;$i<$testa_count;++$i)
 			{
 				if($DEBUG) { echo'<br>Checking if '. (int)$testa[$i] . ' is less than ' . (int)$testb[$i] . ' ...'; }
@@ -792,5 +794,6 @@
 			$less = 0;
 
-			for($i=0;$i<count($testa);++$i)
+            $testa_count = count($testa);
+			for($i=0;$i<$testa_count;++$i)
 			{
 				if($DEBUG) { echo'<br>Checking if '. (int)$testa[$i] . ' is more than ' . (int)$testb[$i] . ' ...'; }
Index: /trunk/phpgwapi/inc/adodb/session/adodb-session.php
===================================================================
--- /trunk/phpgwapi/inc/adodb/session/adodb-session.php	(revision 6057)
+++ /trunk/phpgwapi/inc/adodb/session/adodb-session.php	(revision 7673)
@@ -48,5 +48,6 @@
 	$variables = array( );
 	$a = preg_split( '/(\w+)\|/', $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
-	for( $i = 0; $i < count( $a ); $i = $i+2 ) {
+    $a_count = count( $a );
+	for( $i = 0; $i < $a_count; $i = $i+2 ) {
 		$variables[$a[$i]] = unserialize( $a[$i+1] );
 	}
Index: /trunk/phpgwapi/inc/adodb/session/adodb-session2.php
===================================================================
--- /trunk/phpgwapi/inc/adodb/session/adodb-session2.php	(revision 6057)
+++ /trunk/phpgwapi/inc/adodb/session/adodb-session2.php	(revision 7673)
@@ -78,5 +78,6 @@
 	$variables = array( );
 	$a = preg_split( '/(\w+)\|/', $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
-	for( $i = 0; $i < count( $a ); $i = $i+2 ) {
+    $a_count = count( $a );
+	for( $i = 0; $i < $a_count; $i = $i+2 ) {
 		$variables[$a[$i]] = unserialize( $a[$i+1] );
 	}
Index: /trunk/phpgwapi/inc/class.sbox.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.sbox.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.sbox.inc.php	(revision 7673)
@@ -139,5 +139,6 @@
 		{
 			$out = '';
-			for($i=0;$i<count($this->weekdays);++$i)
+            $weekdays_count = count($this->weekdays);
+			for($i=0;$i<$weekdays_count;++$i)
 			{
 				$out .= '<option value="'.$i.'"'.($selected!=$i?'':' selected').'>'.($this->weekdays[$i]!=''?lang($this->weekdays[$i]):'').'</option>'."\n";
@@ -148,5 +149,6 @@
 		function nr2weekday($selected = 0)
 		{
-			for($i=0;$i<count($this->weekdays);++$i)
+            $weekdays_count = count($this->weekdays);
+			for($i=0;$i<$weekdays_count;++$i)
 			{
 				if ($selected > 0 && $selected == $i)
@@ -251,5 +253,6 @@
 			$out = '<select name="' . $name . '">';
 
-			for($i=1;$i<count($arr);++$i)
+            $arr_count = count($arr);
+			for($i=1;$i<$arr_count;++$i)
 			{
 				$out .= "<option value=\"";
@@ -304,5 +307,6 @@
 				if(@is_array($selected))
 				{
-					for($i=0;$i<count($selected);++$i)
+                    $selected_count = count($selected);
+					for($i=0;$i<$selected_count;++$i)
 					{
 						if ($group['account_id'] == $selected[$i])
Index: /trunk/phpgwapi/inc/common_functions.inc.php
===================================================================
--- /trunk/phpgwapi/inc/common_functions.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/common_functions.inc.php	(revision 7673)
@@ -1083,5 +1083,6 @@
 		$less = 0;
 
-		for ($i=0;$i<count($testa);++$i)
+        $testa_count = count($testa);
+		for ($i=0;$i<$testa_count;++$i)
 		{
 			if ($DEBUG) { echo'<br>Checking if '. (int)$testa[$i] . ' is less than ' . (int)$testb[$i] . ' ...'; }
@@ -1163,5 +1164,6 @@
 		$less = 0;
 
-		for ($i=0;$i<count($testa);++$i)
+        $testa_count = count($testa);
+		for ($i=0;$i<$testa_count;++$i)
 		{
 			if ($DEBUG) { echo'<br>Checking if '. (int)$testa[$i] . ' is more than ' . (int)$testb[$i] . ' ...'; }
Index: /trunk/phpgwapi/inc/class.accounts_contacts.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.accounts_contacts.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.accounts_contacts.inc.php	(revision 7673)
@@ -172,5 +172,6 @@
 
 			/* get user information for each user/group */
-			for($i=0;$i<count($allValues);++$i)
+            $allValues_count = count($allValues);
+			for($i=0;$i<$allValues_count;++$i)
 			{
 				$accounts[] = Array(
Index: /trunk/phpgwapi/inc/class.http.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.http.inc.php	(revision 5912)
+++ /trunk/phpgwapi/inc/class.http.inc.php	(revision 7673)
@@ -265,5 +265,6 @@
 						return('5 it was not specified a valid POST method values array');
 					}
-					for($request_body = '',Reset($values),$value=0;$value<count($values);Next($values),$value++)
+                    $values_count = count($values);
+					for($request_body = '',Reset($values),$value=0;$value<$values_count;Next($values),$value++)
 					{
 						if($value>0)
@@ -296,5 +297,6 @@
 					if(@is_array($header_value))
 					{
-						for(Reset($header_value),$value=0;$value<count($header_value);Next($header_value),$value++)
+                        $header_value_count = count($header_value);
+						for(Reset($header_value),$value=0;$value<$header_value_count;Next($header_value),$value++)
 						{
 							if(!$success = $this->PutLine("$header_name: ".$header_value[Key($header_value)]))
@@ -327,5 +329,6 @@
 					{
 						$now = gmdate('Y-m-d H-i-s');
-						for($cookies = array(),$domain=0,Reset($this->cookies[0]);$domain<count($this->cookies[0]);Next($this->cookies[0]),$domain++)
+                        $cookies_count = count($this->cookies[0]);
+						for($cookies = array(),$domain=0,Reset($this->cookies[0]);$domain<$cookies_count;Next($this->cookies[0]),$domain++)
 						{
 							$domain_pattern = Key($this->cookies[0]);
@@ -335,10 +338,12 @@
 								($match == 0 || $domain_pattern[0] == '.' || $this->request_host[$match-1] == '.'))
 							{
-								for(Reset($this->cookies[0][$domain_pattern]),$path_part=0;$path_part<count($this->cookies[0][$domain_pattern]);Next($this->cookies[0][$domain_pattern]),$path_part++)
+                                $cookies_count = count($this->cookies[0][$domain_pattern]);
+								for(Reset($this->cookies[0][$domain_pattern]),$path_part=0;$path_part<$cookies_count;Next($this->cookies[0][$domain_pattern]),$path_part++)
 								{
 									$path = Key($this->cookies[0][$domain_pattern]);
 									if(strlen($this->request_uri) >= strlen($path) && substr($this->request_uri,0,strlen($path)) == $path)
 									{
-										for(Reset($this->cookies[0][$domain_pattern][$path]),$cookie = 0;$cookie<count($this->cookies[0][$domain_pattern][$path]);Next($this->cookies[0][$domain_pattern][$path]),$cookie++)
+                                        $cookies_count = count($this->cookies[0][$domain_pattern][$path]);
+										for(Reset($this->cookies[0][$domain_pattern][$path]),$cookie = 0;$cookie<$cookies_count;Next($this->cookies[0][$domain_pattern][$path]),$cookie++)
 										{
 											$cookie_name = Key($this->cookies[0][$domain_pattern][$path]);
@@ -353,5 +358,6 @@
 							}
 						}
-						for(Reset($cookies),$cookie=0;$cookie<count($cookies);Next($cookies),$cookie++)
+                        $cookies_count = count($cookies);
+						for(Reset($cookies),$cookie=0;$cookie<$cookies_count;Next($cookies),$cookie++)
 						{
 							$cookie_name = Key($cookies);
@@ -525,11 +531,14 @@
 			{
 				$secure = Key($this->cookies);
-				for($domain = 0,Reset($this->cookies[$secure]);$domain<count($this->cookies[$secure]);Next($this->cookies[$secure]),$domain++)
+                $cookies_count = count($this->cookies[$secure]);
+				for($domain = 0,Reset($this->cookies[$secure]);$domain<$cookies_count;Next($this->cookies[$secure]),$domain++)
 				{
 					$domain_pattern = Key($this->cookies[$secure]);
-					for(Reset($this->cookies[$secure][$domain_pattern]),$path_part=0;$path_part<count($this->cookies[$secure][$domain_pattern]);Next($this->cookies[$secure][$domain_pattern]),$path_part++)
+                    $cookies_count = count($this->cookies[$secure][$domain_pattern]);
+					for(Reset($this->cookies[$secure][$domain_pattern]),$path_part=0;$path_part<$cookies_count;Next($this->cookies[$secure][$domain_pattern]),$path_part++)
 					{
 						$path=Key($this->cookies[$secure][$domain_pattern]);
-						for(Reset($this->cookies[$secure][$domain_pattern][$path]),$cookie=0;$cookie<count($this->cookies[$secure][$domain_pattern][$path]);Next($this->cookies[$secure][$domain_pattern][$path]),$cookie++)
+                        $cookies_count = count($this->cookies[$secure][$domain_pattern][$path]);
+						for(Reset($this->cookies[$secure][$domain_pattern][$path]),$cookie=0;$cookie<$cookies_count;Next($this->cookies[$secure][$domain_pattern][$path]),$cookie++)
 						{
 							$cookie_name = Key($this->cookies[$secure][$domain_pattern][$path]);
Index: /trunk/phpgwapi/inc/class.accounts.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.accounts.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.accounts.inc.php	(revision 7673)
@@ -436,5 +436,6 @@
 			$this->memberships = Array();
 
-			for ($idx=0; $idx<count($security_equals); ++$idx)
+            $security_equals_count = count($security_equals);
+			for ($idx=0; $idx<$security_equals_count; ++$idx)
 			{
 				$groups = (int)$security_equals[$idx];
@@ -463,5 +464,6 @@
 			}
 
-			for ($idx=0; $idx<count($security_equals); ++$idx)
+            $security_equals_count = count($security_equals);
+			for ($idx=0; $idx<$security_equals_count; ++$idx)
 			{
 				$name = $this->id2name((int)$security_equals[$idx]);
Index: /trunk/phpgwapi/inc/class.categories.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.categories.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.categories.inc.php	(revision 7673)
@@ -422,5 +422,6 @@
 			if($self)
 			{
-				for ($i=0;$i<count($cats);++$i)
+                $cats_count = count($cats);
+				for ($i=0;$i<$cats_count;++$i)
 				{
 					if ($cats[$i]['id'] == $self)
@@ -467,5 +468,6 @@
 				if ($this->total_records > 0)
 				{
-					for ($i=0;$i<count($cats);++$i)
+                    $cats_count = count($cats);
+					for ($i=0;$i<$cats_count;++$i)
 					{
 						$image_set = '&nbsp;';
@@ -576,5 +578,6 @@
 				$new_parent = $this->id2name($cat_id,'parent');
 
-				for ($i=0;$i<count($cats);++$i)
+                $cats_count = count($cats);
+				for ($i=0;$i<$cats_count;++$i)
 				{
 					if ($cats[$i]['level'] == 1)
Index: /trunk/phpgwapi/inc/class.soap_server.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.soap_server.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.soap_server.inc.php	(revision 7673)
@@ -359,5 +359,6 @@
 						}
 						// validate each param's type
-						for($i=0; $i < count($p); ++$i)
+                        $p_count = count($p);
+						for($i=0; $i < $p_count; ++$i)
 						{
 							// type not match
Index: /trunk/phpgwapi/inc/fpdf/tutorial/tuto5.php
===================================================================
--- /trunk/phpgwapi/inc/fpdf/tutorial/tuto5.php	(revision 7655)
+++ /trunk/phpgwapi/inc/fpdf/tutorial/tuto5.php	(revision 7673)
@@ -38,5 +38,6 @@
 	$w=array(40,35,40,45);
 	//Header
-	for($i=0;$i<count($header);++$i)
+    $header_count = count($header);
+	for($i=0;$i<$header_count;++$i)
 		$this->Cell($w[$i],7,$header[$i],1,0,'C');
 	$this->Ln();
@@ -65,5 +66,6 @@
 	//Header
 	$w=array(40,35,40,45);
-	for($i=0;$i<count($header);++$i)
+    $header_count = count($header);
+	for($i=0;$i<$header_count;++$i)
 		$this->Cell($w[$i],7,$header[$i],1,0,'C',1);
 	$this->Ln();
Index: /trunk/phpgwapi/inc/fpdf/fpdf.php
===================================================================
--- /trunk/phpgwapi/inc/fpdf/fpdf.php	(revision 7655)
+++ /trunk/phpgwapi/inc/fpdf/fpdf.php	(revision 7673)
@@ -1283,5 +1283,6 @@
 		{
 			$trns='';
-			for($i=0;$i<count($info['trns']);++$i)
+            $info_trns_count = count($info['trns']);
+			for($i=0;$i<$info_trns_count;++$i)
 				$trns.=$info['trns'][$i].' '.$info['trns'][$i].' ';
 			$this->_out('/Mask ['.$trns.']');
Index: /trunk/phpgwapi/inc/class.accounts_ldap.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.accounts_ldap.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.accounts_ldap.inc.php	(revision 7673)
@@ -277,5 +277,6 @@
 					$members = $this->member($this->account_id);
 					$newData['memberuid'] = array();
-					for($i=0;$i<count($members);++$i)
+                    $members_count = count($members);
+					for($i=0;$i<$members_count;++$i)
 					{
 						$currname = $this->id2name($members[$i]['account_id']);
@@ -308,5 +309,6 @@
 					#_debug_array($members);
 					$newData['memberuid'] = array();
-					for($i=0;$i<count($members);++$i)
+                    $members_count = count($members);
+					for($i=0;$i<$members_count;++$i)
 					{
 						$currname = $this->id2name($members[$i]['account_id']);
Index: /trunk/phpgwapi/inc/csstidy/class.csstidy_optimise.php
===================================================================
--- /trunk/phpgwapi/inc/csstidy/class.csstidy_optimise.php	(revision 7655)
+++ /trunk/phpgwapi/inc/csstidy/class.csstidy_optimise.php	(revision 7673)
@@ -302,5 +302,6 @@
             $color_tmp = substr($color,4,strlen($color)-5);
             $color_tmp = explode(',',$color_tmp);
-            for ( $i = 0; $i < count($color_tmp); ++$i )
+            $color_tmp_count = count($color_tmp);
+            for ( $i = 0; $i < $color_tmp_count; ++$i )
             {
                 $color_tmp[$i] = trim ($color_tmp[$i]);
@@ -383,5 +384,6 @@
             $temp = array($subvalue);
         }
-        for ($l = 0; $l < count($temp);++$l)
+        $temp_count = count($temp);
+        for ($l = 0; $l < $temp_count;++$l)
         {
             // continue if no numeric value
@@ -665,5 +667,6 @@
 
         $str_value = csstidy_optimise::explode_ws(',',$str_value);
-        for($i = 0; $i < count($str_value); ++$i)
+        $str_value_count = count($str_value);
+        for($i = 0; $i < $str_value_count; ++$i)
         {
             $have['clip'] = FALSE; $have['pos'] = FALSE;
@@ -672,5 +675,6 @@
             $str_value[$i] = csstidy_optimise::explode_ws(' ',trim($str_value[$i]));
 
-            for($j = 0; $j < count($str_value[$i]); ++$j)
+            $str_value_count = count($str_value[$i]);
+            for($j = 0; $j < $str_value_count; ++$j)
             {
                 if($have['bg'] === FALSE && (substr($str_value[$i][$j],0,4) == 'url(' || $str_value[$i][$j] === 'none'))
Index: /trunk/phpgwapi/inc/csstidy/class.csstidy.php
===================================================================
--- /trunk/phpgwapi/inc/csstidy/class.csstidy.php	(revision 7655)
+++ /trunk/phpgwapi/inc/csstidy/class.csstidy.php	(revision 7673)
@@ -419,5 +419,6 @@
 	$template = explode('|',$content);
 
-	for ($i = 0; $i < count($template); ++$i )
+    $template_count = count($template);
+	for ($i = 0; $i < $template_count; ++$i )
 	{
 		$this->template[$i] = $template[$i];
Index: /trunk/phpgwapi/inc/class.phpmailer.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.phpmailer.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.phpmailer.inc.php	(revision 7673)
@@ -443,5 +443,6 @@
     function MailSend($header, $body) {
         $to = "";
-        for($i = 0; $i < count($this->to); ++$i)
+        $to_count = count($this->to);
+        for($i = 0; $i < $to_count; ++$i)
         {
             if($i != 0) { $to .= ", "; }
@@ -497,15 +498,18 @@
 
         // Attempt to send attach all recipients
-        for($i = 0; $i < count($this->to); ++$i)
+        $to_count = count($this->to);
+        for($i = 0; $i < $to_count; ++$i)
         {
             if(!$this->smtp->Recipient($this->to[$i][0]))
                 $bad_rcpt[] = $this->to[$i][0];
         }
-        for($i = 0; $i < count($this->cc); ++$i)
+        $cc_count = count($this->cc);
+        for($i = 0; $i < $cc_count; ++$i)
         {
             if(!$this->smtp->Recipient($this->cc[$i][0]))
                 $bad_rcpt[] = $this->cc[$i][0];
         }
-        for($i = 0; $i < count($this->bcc); ++$i)
+        $bcc_count = count($this->bcc);
+        for($i = 0; $i < $bcc_count; ++$i)
         {
             if(!$this->smtp->Recipient($this->bcc[$i][0]))
@@ -515,5 +519,6 @@
         if(count($bad_rcpt) > 0) // Create error message
         {
-            for($i = 0; $i < count($bad_rcpt); ++$i)
+            $bad_rcpt_count = count($bad_rcpt);
+            for($i = 0; $i < $bad_rcpt_count; ++$i)
             {
                 if($i != 0) { $error .= ", "; }
@@ -645,5 +650,6 @@
         if(count($addr) > 1)
         {
-            for($i = 1; $i < count($addr); ++$i)
+            $addr_count = count($addr);
+            for($i = 1; $i < $addr_count; ++$i)
                 $addr_str .= ", " . $this->AddrFormat($addr[$i]);
         }
@@ -686,9 +692,11 @@
         $line = explode($this->LE, $message);
         $message = "";
-        for ($i=0 ;$i < count($line); ++$i)
+        $line_count = count($line);
+        for ($i=0 ;$i < $line_count; ++$i)
         {
           $line_part = explode(" ", $line[$i]);
           $buf = "";
-          for ($e = 0; $e<count($line_part); ++$e)
+          $line_part_count = count($line_part);
+          for ($e = 0; $e<$line_part_count; ++$e)
           {
               $word = $line_part[$e];
@@ -830,5 +838,6 @@
 
         // Add custom headers
-        for($index = 0; $index < count($this->CustomHeader); ++$index)
+        $CustomHeader_count = count($this->CustomHeader);
+        for($index = 0; $index < $CustomHeader_count; ++$index)
         {
             $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), 
@@ -1053,5 +1062,6 @@
 
         // Add all attachments
-        for($i = 0; $i < count($this->attachment); ++$i)
+        $attachment_count = count($this->attachment);
+        for($i = 0; $i < $attachment_count; ++$i)
         {
             // Check for string attachment
@@ -1326,5 +1336,6 @@
     function InlineImageExists() {
         $result = false;
-        for($i = 0; $i < count($this->attachment); ++$i)
+        $attachment_count = count($this->attachment);
+        for($i = 0; $i < $attachment_count; ++$i)
         {
             if($this->attachment[$i][6] == "inline")
Index: /trunk/phpgwapi/inc/class.common.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.common.inc.php	(revision 7655)
+++ /trunk/phpgwapi/inc/class.common.inc.php	(revision 7673)
@@ -435,5 +435,6 @@
 			$html_error = '<table border="0" width="100%"><tr><td align="right"><b>' . lang($text)
 				. '</b>: </td><td align="left">' . $errors[0] . '</td></tr>';
-			for ($i=1; $i<count($errors); ++$i)
+            $errors_count = count($errors);
+			for ($i=1; $i<$errors_count; ++$i)
 			{
 				$html_error .= '<tr><td>&nbsp;</td><td align="left">' . $errors[$i] . '</td></tr>';
Index: /trunk/phpgwapi/templates/classic/login_classic.php
===================================================================
--- /trunk/phpgwapi/templates/classic/login_classic.php	(revision 7655)
+++ /trunk/phpgwapi/templates/classic/login_classic.php	(revision 7673)
@@ -238,6 +238,7 @@
 		$obj_organization = CreateObject('phpgwapi.sector_search_ldap');
 		$organizations = $obj_organization->organization_search($GLOBALS['phpgw_info']['server']['ldap_context']);
-		
-		for ($i=0; $i<count($organizations); ++$i)
+
+        $organizations_count = count($organizations);
+		for ($i=0; $i<$organizations_count; ++$i)
 		{
 			$tmp_array[strtolower($organizations[$i])] = $organizations[$i];	
Index: /trunk/phpgwapi/templates/default/login_default.php
===================================================================
--- /trunk/phpgwapi/templates/default/login_default.php	(revision 7655)
+++ /trunk/phpgwapi/templates/default/login_default.php	(revision 7673)
@@ -350,6 +350,7 @@
 		$obj_organization = CreateObject('phpgwapi.sector_search_ldap');
 		$organizations = $obj_organization->organization_search($GLOBALS['phpgw_info']['server']['ldap_context']);
-		
-		for ($i=0; $i<count($organizations); ++$i)
+
+        $organizations_count = count($organizations);
+		for ($i=0; $i<$organizations_count; ++$i)
 		{
 			$tmp_array[strtolower($organizations[$i])] = $organizations[$i];	
Index: /trunk/phpgwapi/templates/news/login_news.php
===================================================================
--- /trunk/phpgwapi/templates/news/login_news.php	(revision 7655)
+++ /trunk/phpgwapi/templates/news/login_news.php	(revision 7673)
@@ -286,6 +286,7 @@
 		$obj_organization = CreateObject('phpgwapi.sector_search_ldap');
 		$organizations = $obj_organization->organization_search($GLOBALS['phpgw_info']['server']['ldap_context']);
-		
-		for ($i=0; $i<count($organizations); ++$i)
+
+        $organizations_count = count($organizations);
+		for ($i=0; $i<$organizations_count; ++$i)
 		{
 			$tmp_array[strtolower($organizations[$i])] = $organizations[$i];	
Index: /trunk/reports/inc/class.fpdf.inc.php
===================================================================
--- /trunk/reports/inc/class.fpdf.inc.php	(revision 7655)
+++ /trunk/reports/inc/class.fpdf.inc.php	(revision 7673)
@@ -1589,5 +1589,6 @@
 		{
 			$trns='';
-			for($i=0;$i<count($info['trns']);++$i)
+            $info_trns_count = count($info['trns']);
+			for($i=0;$i<$info_trns_count;++$i)
 				$trns.=$info['trns'][$i].' '.$info['trns'][$i].' ';
 			$this->_out('/Mask ['.$trns.']');
Index: /trunk/reports/inc/class.uireports_fpdf.inc.php
===================================================================
--- /trunk/reports/inc/class.uireports_fpdf.inc.php	(revision 7655)
+++ /trunk/reports/inc/class.uireports_fpdf.inc.php	(revision 7673)
@@ -38,5 +38,6 @@
 		//Calculate the height of the row
 		$nb=0;
-		for($i=0;$i< count($data);++$i)
+        $data_count = count($data);
+		for($i=0;$i< $data_count;++$i)
 		$nb=max($nb,$this->NbLines($this->widths[$i],$data[$i]));
 		$h=5*$nb;
@@ -44,5 +45,6 @@
 		$this->CheckPageBreak($h);
 		//Draw the cells of the row
-		for($i=0;$i< count($data);++$i)
+        $data_count = count($data);
+		for($i=0;$i< $data_count;++$i)
 		{
 			$w=$this->widths[$i];
Index: /trunk/reports/inc/class.ldap_functions.inc.php
===================================================================
--- /trunk/reports/inc/class.ldap_functions.inc.php	(revision 7655)
+++ /trunk/reports/inc/class.ldap_functions.inc.php	(revision 7673)
@@ -136,5 +136,6 @@
 				$entry[0]['dn'] = strtolower($entry[0]['dn']);
 				$sector_dn_array = explode(",", $entry[0]['dn']);
-				for($i=1; $i<count($sector_dn_array); ++$i)
+                $sector_dn_array_count = count($sector_dn_array);
+				for($i=1; $i<$sector_dn_array_count; ++$i)
 					$sector_dn .= $sector_dn_array[$i] . ',';
 				//Retira ultimo pipe.
@@ -268,5 +269,6 @@
 				$entry[0]['dn'] = strtolower($entry[0]['dn']);
 				$sector_dn_array = explode(",", $entry[0]['dn']);
-				for($i=1; $i<count($sector_dn_array); ++$i)
+                $sector_dn_array_count = count($sector_dn_array);
+				for($i=1; $i<$sector_dn_array_count; ++$i)
 					$sector_dn .= $sector_dn_array[$i] . ',';
 				//Retira ultimo pipe.
@@ -366,5 +368,6 @@
 				$entry[0]['dn'] = strtolower($entry[0]['dn']);
 				$sector_dn_array = explode(",", $entry[0]['dn']);
-				for($i=1; $i<count($sector_dn_array); ++$i)
+                $sector_dn_array_count = count($sector_dn_array);
+				for($i=1; $i<$sector_dn_array_count; ++$i)
 					$sector_dn .= $sector_dn_array[$i] . ',';
 				//Retira ultimo pipe.
Index: /trunk/library/Mail/Mail/RFC822.php
===================================================================
--- /trunk/library/Mail/Mail/RFC822.php	(revision 7655)
+++ /trunk/library/Mail/Mail/RFC822.php	(revision 7673)
@@ -332,5 +332,6 @@
         $string = $parts[0];
 
-        for ($i = 0; $i < count($parts); ++$i) {
+        $parts_count = count($parts);
+        for ($i = 0; $i < $parts_count; ++$i) {
             if ($this->_hasUnclosedQuotes($string)
                 || $this->_hasUnclosedBrackets($string, '<>')
@@ -426,5 +427,6 @@
     {
         $parts = explode($char, $string);
-        for ($i = 0; $i < count($parts); ++$i){
+        $parts_count = count($parts);
+        for ($i = 0; $i < $parts_count; ++$i){
             if (substr($parts[$i], -1) == '\\' || $this->_hasUnclosedQuotes($parts[$i]))
                 $num--;
@@ -500,5 +502,6 @@
         //                         geezer
         // ... or any other format valid by RFC 822.
-        for ($i = 0; $i < count($addresses); ++$i) {
+        $addresses_count = count($addresses);
+        for ($i = 0; $i < $addresses_count; ++$i) {
             if (!$this->validateMailbox($addresses[$i])) {
                 if (empty($this->error)) {
Index: /trunk/library/Mail/Mail/smtpmx.php
===================================================================
--- /trunk/library/Mail/Mail/smtpmx.php	(revision 5146)
+++ /trunk/library/Mail/Mail/smtpmx.php	(revision 7673)
@@ -436,5 +436,6 @@
                 return false;
             }
-            for ($i = 0; $i < count($mxHost); ++$i) {
+            $mxHost_count = count($mxHost);
+            for ($i = 0; $i < $mxHost_count; ++$i) {
                 $mx[$mxHost[$i]] = $mxWeight[$i];
             }
Index: /trunk/library/csstidy/class.csstidy_optimise.php
===================================================================
--- /trunk/library/csstidy/class.csstidy_optimise.php	(revision 7655)
+++ /trunk/library/csstidy/class.csstidy_optimise.php	(revision 7673)
@@ -302,5 +302,6 @@
             $color_tmp = substr($color,4,strlen($color)-5);
             $color_tmp = explode(',',$color_tmp);
-            for ( $i = 0; $i < count($color_tmp); ++$i )
+            $color_tmp_count = count($color_tmp);
+            for ( $i = 0; $i < $color_tmp_count; ++$i )
             {
                 $color_tmp[$i] = trim ($color_tmp[$i]);
@@ -383,5 +384,6 @@
             $temp = array($subvalue);
         }
-        for ($l = 0; $l < count($temp); ++$l)
+        $temp_count = count($temp);
+        for ($l = 0; $l < $temp_count; ++$l)
         {
             // continue if no numeric value
@@ -665,5 +667,6 @@
 
         $str_value = csstidy_optimise::explode_ws(',',$str_value);
-        for($i = 0; $i < count($str_value); ++$i)
+        $str_value_count = count($str_value);
+        for($i = 0; $i < $str_value_count; ++$i)
         {
             $have['clip'] = FALSE; $have['pos'] = FALSE;
@@ -672,5 +675,6 @@
             $str_value[$i] = csstidy_optimise::explode_ws(' ',trim($str_value[$i]));
 
-            for($j = 0; $j < count($str_value[$i]); ++$j)
+            $str_value_count = count($str_value[$i]);
+            for($j = 0; $j < $str_value_count; ++$j)
             {
                 if($have['bg'] === FALSE && (substr($str_value[$i][$j],0,4) == 'url(' || $str_value[$i][$j] === 'none'))
Index: /trunk/library/csstidy/css_optimiser.php
===================================================================
--- /trunk/library/csstidy/css_optimiser.php	(revision 7655)
+++ /trunk/library/csstidy/css_optimiser.php	(revision 7673)
@@ -322,5 +322,6 @@
 			{
 				echo '<dt>'.$line.'</dt>';
-				for($i = 0; $i < count($array); ++$i)
+                $array_count = count($array);
+				for($i = 0; $i < $array_count; ++$i)
 				{
 					echo '<dd class="'.$array[$i]['t'].'">'.$array[$i]['m'].'</dd>';
Index: /trunk/library/csstidy/class.csstidy.php
===================================================================
--- /trunk/library/csstidy/class.csstidy.php	(revision 7655)
+++ /trunk/library/csstidy/class.csstidy.php	(revision 7673)
@@ -419,5 +419,6 @@
 	$template = explode('|',$content);
 
-	for ($i = 0; $i < count($template); ++$i )
+    $template_count = count($template);
+	for ($i = 0; $i < $template_count; ++$i )
 	{
 		$this->template[$i] = $template[$i];
Index: /trunk/library/ckeditor/plugins/aspell/spellerpages/server-scripts/spellchecker.php
===================================================================
--- /trunk/library/ckeditor/plugins/aspell/spellerpages/server-scripts/spellchecker.php	(revision 7655)
+++ /trunk/library/ckeditor/plugins/aspell/spellerpages/server-scripts/spellchecker.php	(revision 7673)
@@ -82,5 +82,6 @@
 	# open temp file, add the submitted text.
 	if( $fh = fopen( $tempfile, 'w' )) {
-		for( $i = 0; $i < count( $textinputs ); ++$i ) {
+        $textinputs_count = count( $textinputs );
+		for( $i = 0; $i < $textinputs_count; ++$i ) {
 			$text = urldecode( $textinputs[$i] );
                         $text = html_entity_decode ($text , ENT_QUOTES , 'UTF-8'  );
Index: /trunk/library/Net/Sieve.php
===================================================================
--- /trunk/library/Net/Sieve.php	(revision 7655)
+++ /trunk/library/Net/Sieve.php	(revision 7673)
@@ -929,5 +929,6 @@
         $data = preg_split('/\r?\n/', $this->_toUpper($data), -1, PREG_SPLIT_NO_EMPTY);
 
-        for ($i = 0; $i < count($data); ++$i) {
+        $data_count = count($data);
+        for ($i = 0; $i < $data_count; ++$i) {
             if (!preg_match('/^"([A-Z]+)"( "(.*)")?$/', $data[$i], $matches)) {
                 continue;
Index: /trunk/library/PEAR/PEAR/Frontend/CLI.php
===================================================================
--- /trunk/library/PEAR/PEAR/Frontend/CLI.php	(revision 7655)
+++ /trunk/library/PEAR/PEAR/Frontend/CLI.php	(revision 7673)
@@ -579,5 +579,6 @@
     {
         $highest = 1;
-        for ($i = 0; $i < count($columns); ++$i) {
+        $columns_count = count($columns);
+        for ($i = 0; $i < $columns_count; ++$i) {
             $col = &$columns[$i];
             if (isset($colparams[$i]) && !empty($colparams[$i]['wrap'])) {
@@ -672,5 +673,6 @@
         }
 
-        for ($i = 0; $i < count($table_data); ++$i) {
+        $table_data_count = count($table_data);
+        for ($i = 0; $i < $table_data_count; ++$i) {
             extract($table_data[$i]);
             if (!is_array($rowparams)) {
@@ -684,5 +686,6 @@
             $rowlines = array();
             if ($height > 1) {
-                for ($c = 0; $c < count($data); $c++) {
+                $data_count = count($data);
+                for ($c = 0; $c < $data_count; $c++) {
                     $rowlines[$c] = preg_split('/(\r?\n|\r)/', $data[$c]);
                     if (count($rowlines[$c]) < $height) {
@@ -691,5 +694,6 @@
                 }
             } else {
-                for ($c = 0; $c < count($data); ++$c) {
+                $data_count = count($data);
+                for ($c = 0; $c < $data_count; ++$c) {
                     $rowlines[$c] = array($data[$c]);
                 }
@@ -698,5 +702,6 @@
             for ($r = 0; $r < $height; ++$r) {
                 $rowtext = '';
-                for ($c = 0; $c < count($data); ++$c) {
+                $data_count = count($data);
+                for ($c = 0; $c < $data_count; ++$c) {
                     if (isset($colparams[$c])) {
                         $attribs = array_merge($rowparams, $colparams);
Index: /trunk/library/PEAR/PEAR/PackageFile/v2.php
===================================================================
--- /trunk/library/PEAR/PEAR/PackageFile/v2.php	(revision 7655)
+++ /trunk/library/PEAR/PEAR/PackageFile/v2.php	(revision 7673)
@@ -329,7 +329,9 @@
         $mymaintainers = $this->getMaintainers();
         $yourmaintainers = $pf1->getMaintainers();
-        for ($i1 = 0; $i1 < count($yourmaintainers); ++$i1) {
+        $yourmaintainers_count = count($yourmaintainers);
+        for ($i1 = 0; $i1 < $yourmaintainers_count; ++$i1) {
             $reset = false;
-            for ($i2 = 0; $i2 < count($mymaintainers); ++$i2) {
+            $mymaintainers_count = count($mymaintainers);
+            for ($i2 = 0; $i2 < $mymaintainers_count; ++$i2) {
                 if ($mymaintainers[$i2]['handle'] == $yourmaintainers[$i1]['handle']) {
                     if ($mymaintainers[$i2]['role'] != $yourmaintainers[$i1]['role']) {
@@ -1213,5 +1215,6 @@
             }
 
-            for ($i = 0; $i < count($releases['configureoption']); ++$i) {
+            $releases_count = count($releases['configureoption']);
+            for ($i = 0; $i < $releases_count; ++$i) {
                 $releases['configureoption'][$i] = $releases['configureoption'][$i]['attribs'];
             }
Index: /trunk/library/mime/mimeDecode.php
===================================================================
--- /trunk/library/mime/mimeDecode.php	(revision 7655)
+++ /trunk/library/mime/mimeDecode.php	(revision 7673)
@@ -326,5 +326,6 @@
 
                     $parts = $this->_boundarySplit($body, $content_type['other']['boundary']);
-                    for ($i = 0; $i < count($parts); ++$i) {
+                    $parts_count = count($parts);
+                    for ($i = 0; $i < $parts_count; ++$i) {
                         list($part_header, $part_body) = $this->_splitBodyHeader($parts[$i]);
                         $part = $this->_decode($part_header, $part_body, $default_ctype);
@@ -386,6 +387,6 @@
                 $return[$prepend . $mime_number] = &$structure;
             }
-            for ($i = 0; $i < count($structure->parts); ++$i) {
-
+            $structure_parts_count = count($structure->parts);
+            for ($i = 0; $i < $structure_parts_count; ++$i) {
             
                 if (!empty($structure->headers['content-type']) AND substr(strtolower($structure->headers['content-type']), 0, 8) == 'message/') {
@@ -792,5 +793,6 @@
         preg_match_all("/begin ([0-7]{3}) (.+)\r?\n(.+)\r?\nend/Us", $input, $matches);
 
-        for ($j = 0; $j < count($matches[3]); ++$j) {
+        $matches_count = count($matches[3]);
+        for ($j = 0; $j < $matches_count; ++$j) {
 
             $str      = $matches[3][$j];
@@ -943,5 +945,6 @@
             // Multiple headers with this name
             if (is_array($headers[$hdr_name])) {
-                for ($i = 0; $i < count($hdr_value); ++$i) {
+                $hdr_value_count = count($hdr_value);
+                for ($i = 0; $i < $hdr_value_count; ++$i) {
                     $output .= Mail_mimeDecode::_getXML_helper($hdr_name, $hdr_value[$i], $indent);
                 }
@@ -954,5 +957,6 @@
 
         if (!empty($input->parts)) {
-            for ($i = 0; $i < count($input->parts); ++$i) {
+            $parts_count = count($input->parts);
+            for ($i = 0; $i < $parts_count; ++$i) {
                 $output .= $crlf . str_repeat($htab, $indent) . '<mimepart>' . $crlf .
                            Mail_mimeDecode::_getXML($input->parts[$i], $indent+1) .
Index: /trunk/library/mime/mimePart.php
===================================================================
--- /trunk/library/mime/mimePart.php	(revision 7655)
+++ /trunk/library/mime/mimePart.php	(revision 7673)
@@ -283,5 +283,6 @@
             $encoded['body'] = ''; 
 
-            for ($i = 0; $i < count($this->_subparts); ++$i) {
+            $subparts_count = count($this->_subparts);
+            for ($i = 0; $i < $subparts_count; ++$i) {
                 $encoded['body'] .= '--' . $boundary . $eol;
                 $tmp = $this->_subparts[$i]->encode();
@@ -393,5 +394,6 @@
 
         if (count($this->_subparts)) {
-            for ($i = 0; $i < count($this->_subparts); ++$i) {
+            $subparts_count = count($this->_subparts);
+            for ($i = 0; $i < $subparts_count; ++$i) {
                 fwrite($fh, $f_eol . '--' . $boundary . $eol);
                 $res = $this->_subparts[$i]->_encodePartToFile($fh);
Index: /trunk/library/mime/mime.php
===================================================================
--- /trunk/library/mime/mime.php	(revision 7655)
+++ /trunk/library/mime/mime.php	(revision 7673)
@@ -895,5 +895,6 @@
         case !$text && !$html && $attachments:
             $message =& $this->_addMixedPart();
-            for ($i = 0; $i < count($this->_parts); ++$i) {
+            $parts_count = count($this->_parts);
+            for ($i = 0; $i < $parts_count; ++$i) {
                 $this->_addAttachmentPart($message, $this->_parts[$i]);
             }
@@ -903,5 +904,6 @@
             $message =& $this->_addMixedPart();
             $this->_addTextPart($message, $this->_txtbody);
-            for ($i = 0; $i < count($this->_parts); ++$i) {
+            $parts_count = count($this->_parts);
+            for ($i = 0; $i < $parts_count; ++$i) {
                 $this->_addAttachmentPart($message, $this->_parts[$i]);
             }
@@ -930,5 +932,6 @@
                 $ht =& $this->_addRelatedPart($message);
                 $this->_addHtmlPart($ht);
-                for ($i = 0; $i < count($this->_html_images); ++$i) {
+                $html_images_count = count($this->_html_images);
+                for ($i = 0; $i < $html_images_count; ++$i) {
                     $this->_addHtmlImagePart($ht, $this->_html_images[$i]);
                 }
@@ -939,5 +942,6 @@
                 $message =& $this->_addRelatedPart($null);
                 $this->_addHtmlPart($message);
-                for ($i = 0; $i < count($this->_html_images); ++$i) {
+                $html_images_count = count($this->_html_images);
+                for ($i = 0; $i < $html_images_count; ++$i) {
                     $this->_addHtmlImagePart($message, $this->_html_images[$i]);
                 }
@@ -958,5 +962,6 @@
                 $this->_addHtmlPart($message);
             }
-            for ($i = 0; $i < count($this->_html_images); ++$i) {
+            $html_images_count = count($this->_html_images);
+            for ($i = 0; $i < $html_images_count; ++$i) {
                 $this->_addHtmlImagePart($message, $this->_html_images[$i]);
             }
@@ -973,5 +978,6 @@
                 $this->_addHtmlPart($message);
             }
-            for ($i = 0; $i < count($this->_parts); ++$i) {
+            $parts_count = count($this->_parts);
+            for ($i = 0; $i < $parts_count; ++$i) {
                 $this->_addAttachmentPart($message, $this->_parts[$i]);
             }
@@ -989,8 +995,10 @@
             }
             $this->_addHtmlPart($rel);
-            for ($i = 0; $i < count($this->_html_images); ++$i) {
+		    $html_images_count = count($this->_html_images);
+            for ($i = 0; $i < $html_images_count; ++$i) {
                 $this->_addHtmlImagePart($rel, $this->_html_images[$i]);
             }
-            for ($i = 0; $i < count($this->_parts); ++$i) {
+		    $parts_count = count($this->_parts);
+            for ($i = 0; $i < $parts_count; ++$i) {
                 $this->_addAttachmentPart($message, $this->_parts[$i]);
             }
@@ -1008,9 +1016,11 @@
 				$this->_addHtmlPart($message);
             }
-			
-            for ($i = 0; $i < count($this->_html_images); ++$i) {
+
+			$html_images_count = count($this->_html_images);
+            for ($i = 0; $i < $html_images_count; ++$i) {
                 $this->_addHtmlImagePart($message, $this->_html_images[$i]);
             }
-            for ($i = 0; $i < count($this->_parts); ++$i) {
+            $parts_count = count($this->_parts);
+            for ($i = 0; $i < $parts_count; ++$i) {
                 $this->_addAttachmentPart($message, $this->_parts[$i]);
             }
Index: /trunk/filemanager/tp/dompdf/include/cpdf_adapter.cls.php
===================================================================
--- /trunk/filemanager/tp/dompdf/include/cpdf_adapter.cls.php	(revision 7655)
+++ /trunk/filemanager/tp/dompdf/include/cpdf_adapter.cls.php	(revision 7673)
@@ -570,5 +570,6 @@
     
     // Adjust y values
-    for ( $i = 1; $i < count($points); $i += 2)
+    $points_count = count($points);
+    for ( $i = 1; $i < $points_count; $i += 2)
       $points[$i] = $this->y($points[$i]);
     
Index: /trunk/filemanager/tp/dompdf/include/text_frame_reflower.cls.php
===================================================================
--- /trunk/filemanager/tp/dompdf/include/text_frame_reflower.cls.php	(revision 6057)
+++ /trunk/filemanager/tp/dompdf/include/text_frame_reflower.cls.php	(revision 7673)
@@ -134,5 +134,6 @@
     reset($words);
 
-    for ($i = 0; $i < count($words); $i += 2) {
+    $words_count = count($words);
+    for ($i = 0; $i < $words_count; $i += 2) {
       $word = $words[$i] . (isset($words[$i+1]) ? $words[$i+1] : "");
       $word_width = Font_Metrics::get_text_width($word, $font, $size, $word_spacing);
Index: /trunk/filemanager/tp/dompdf/lib/class.pdf.php
===================================================================
--- /trunk/filemanager/tp/dompdf/lib/class.pdf.php	(revision 7655)
+++ /trunk/filemanager/tp/dompdf/lib/class.pdf.php	(revision 7673)
@@ -2615,5 +2615,6 @@
                   $dtmp[$bits2[0]] = array();
 
-                  for  ($i = 1;$i<count($bits2);++$i) {
+                  $bits2_count = count($bits2);
+                  for  ($i = 1;$i<$bits2_count;++$i) {
 
                     $dtmp[$bits2[0]][] = $bits2[$i];
@@ -2661,5 +2662,6 @@
                     $dtmp[$bits2[0]] = array();
 
-                    for  ($i = 1;$i<count($bits2);++$i) {
+                    $bits2_count = count($bits2);
+                    for  ($i = 1;$i<$bits2_count;++$i) {
 
                       $dtmp[$bits2[0]][] = $bits2[$i];
Index: /trunk/filemanager/inc/class.uiconfig.inc.php
===================================================================
--- /trunk/filemanager/inc/class.uiconfig.inc.php	(revision 7655)
+++ /trunk/filemanager/inc/class.uiconfig.inc.php	(revision 7673)
@@ -272,6 +272,7 @@
 				$result = $notify->SearchId($_GET['editUser']);
 				$emails_to = explode(",", $result[0]['email_to']);
-				
-				for( $i = 0 ; $i < count($emails_to); ++$i )
+
+                $emails_to_count = count($emails_to);
+				for( $i = 0 ; $i < $emails_to_count; ++$i )
 				{
 					$value_email_to .= "<tr>";
Index: /trunk/filemanager/inc/class.uifilemanager.inc.php
===================================================================
--- /trunk/filemanager/inc/class.uifilemanager.inc.php	(revision 7655)
+++ /trunk/filemanager/inc/class.uifilemanager.inc.php	(revision 7673)
@@ -1211,5 +1211,6 @@
 				reset($this->files_array);
 				$this->readFilesInfo();
-				for ($i = 0; $i < count($this->files_array); ++$i) {
+                $files_array_count = count($this->files_array);
+				for ($i = 0; $i < $files_array_count; ++$i) {
 					$comment = strtoupper($this->files_array[$i]['comment']);
 					$name = strtoupper($this->files_array[$i]['name']);
Index: /trunk/filemanager/inc/class.notifications.inc.php
===================================================================
--- /trunk/filemanager/inc/class.notifications.inc.php	(revision 7655)
+++ /trunk/filemanager/inc/class.notifications.inc.php	(revision 7673)
@@ -110,6 +110,7 @@
 			
 			$email_to = explode( ",", $result[0]['email_to'] );
-			
-			for( $i = 0 ; $i < count($email_to); ++$i )
+
+            $email_to_count = count($email_to);
+			for( $i = 0 ; $i < $email_to_count; ++$i )
 			{
 				if($email_to[$i] == $emailTo)
Index: /trunk/expressoAdmin1_2/inc/class.db_functions.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.db_functions.inc.php	(revision 7655)
+++ /trunk/expressoAdmin1_2/inc/class.db_functions.inc.php	(revision 7673)
@@ -141,5 +141,6 @@
 		
 		//Escrevre no Banco as aplicações que o gerente tem direito de disponibilizar aos seus usuarios.
-		for ($i=0; $i<count($aplications); ++$i)
+        $aplications_count = count($aplications);
+		for ($i=0; $i<$aplications_count; ++$i)
 		{
 			$sql = "INSERT INTO phpgw_expressoadmin_apps (manager_lid, context, app) "
@@ -415,6 +416,7 @@
 		while($this->db->next_record())
 			$user_app[] = $this->db->row();
-		
-		for ($i=0; $i<count($user_app); ++$i)
+
+        $user_app_count = count($user_app);
+		for ($i=0; $i<$user_app_count; ++$i)
 			$return['groups'][] = $user_app[$i]['acl_location'];
 		
Index: /trunk/expressoAdmin1_2/inc/class.bomessages_size.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.bomessages_size.inc.php	(revision 7655)
+++ /trunk/expressoAdmin1_2/inc/class.bomessages_size.inc.php	(revision 7673)
@@ -285,5 +285,6 @@
 			$rules_tr = '';
 
-			for ($i = 0; $i<count($rules); ++$i)
+            $rules_count = count($rules);
+			for ($i = 0; $i<$rules_count; ++$i)
 			{
 				$name_link = (string)str_replace(" ", "%", $rules[$i]['email_recipient']);
@@ -311,5 +312,6 @@
 			$rules_tr = '';
 
-			for ($i = 0; $i<count($rules); ++$i)
+            $rules_count = count($rules);
+			for ($i = 0; $i<$rules_count; ++$i)
 			{
 				$name_link = (string)str_replace(" ", "%", $rules[$i]['email_recipient']);
Index: /trunk/expressoAdmin1_2/inc/class.socomputers.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.socomputers.inc.php	(revision 7655)
+++ /trunk/expressoAdmin1_2/inc/class.socomputers.inc.php	(revision 7673)
@@ -86,5 +86,6 @@
 					// Recupera o contexto do email_list
 					$tmp = explode(",", $computer_data['dn']);
-					for ($i = 1; $i < count($tmp); ++$i)
+                    $tmp_count = count($tmp);
+					for ($i = 1; $i < $tmp_count; ++$i)
 						$computer_data['context'] .= $tmp[$i] . ',';
 					$computer_data['context'] = substr($computer_data['context'],0,(strlen($computer_data['context']) - 1));
Index: /trunk/expressoAdmin1_2/inc/class.uimessages_size.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.uimessages_size.inc.php	(revision 7655)
+++ /trunk/expressoAdmin1_2/inc/class.uimessages_size.inc.php	(revision 7673)
@@ -114,6 +114,7 @@
 			$rules = '';
             $all_rules = $this->bo->get_all_rules();
-			
-			for ($i = 0; $i<count($all_rules); ++$i)
+
+            $all_rules_count = count($all_rules);
+			for ($i = 0; $i<$all_rules_count; ++$i)
 			{	
 				/* Verificação para não listar a regra default */
Index: /trunk/expressoAdmin1_2/inc/class.bosectors.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.bosectors.inc.php	(revision 7655)
+++ /trunk/expressoAdmin1_2/inc/class.bosectors.inc.php	(revision 7673)
@@ -162,5 +162,6 @@
 			$sector_users = $this->so->get_sector_users($sector_dn);
 
-			for ($i=0; $i<count($sector_users)-1; ++$i)
+            $sector_users_count = count($sector_users)-1;
+			for ($i=0; $i<$sector_users_count; ++$i)
 			{
 				//_debug_array($user);
@@ -174,5 +175,6 @@
 
 			$sector_groups = $this->so->get_sector_groups($sector_dn);
-			for ($i=0; $i<count($sector_groups)-1; ++$i)
+            $sector_groups_count = count($sector_groups)-1;
+			for ($i=0; $i<$sector_groups_count; ++$i)
 			{
  				$dn = $sector_groups[$i]['dn'];
Index: /trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php	(revision 7655)
+++ /trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php	(revision 7673)
@@ -1571,5 +1571,6 @@
 				$entry[0]['dn'] = strtolower($entry[0]['dn']);
 				$sector_dn_array = explode(",", $entry[0]['dn']);
-				for($i=1; $i<count($sector_dn_array); ++$i)
+                $sector_dn_array_count = count($sector_dn_array);
+				for($i=1; $i<$sector_dn_array_count; ++$i)
 					$sector_dn .= $sector_dn_array[$i] . ',';
 				//Retira ultimo pipe.
@@ -1698,5 +1699,6 @@
 				$entry[0]['dn'] = strtolower($entry[0]['dn']);
 				$sector_dn_array = explode(",", $entry[0]['dn']);
-				for($i=1; $i<count($sector_dn_array); ++$i)
+                $sector_dn_array_count = count($sector_dn_array);
+				for($i=1; $i<$sector_dn_array_count; ++$i)
 					$sector_dn .= $sector_dn_array[$i] . ',';
 				//Retira ultimo pipe.
@@ -1831,5 +1833,6 @@
 				$entry[0]['dn'] = strtolower($entry[0]['dn']);
 				$sector_dn_array = explode(",", $entry[0]['dn']);
-				for($i=1; $i<count($sector_dn_array); ++$i)
+                $sector_dn_array_count = count($sector_dn_array);
+				for($i=1; $i<$sector_dn_array_count; ++$i)
 					$sector_dn .= $sector_dn_array[$i] . ',';
 				//Retira ultimo pipe.
@@ -1929,5 +1932,6 @@
 				$entry[0]['dn'] = strtolower($entry[0]['dn']);
 				$sector_dn_array = explode(",", $entry[0]['dn']);
-				for($i=1; $i<count($sector_dn_array); ++$i)
+                $sector_dn_array_count = count($sector_dn_array);
+				for($i=1; $i<$sector_dn_array_count; ++$i)
 					$sector_dn .= $sector_dn_array[$i] . ',';
 				//Retira ultimo pipe.
@@ -2001,5 +2005,6 @@
 				$entry[0]['dn'] = strtolower($entry[0]['dn']);
 				$sector_dn_array = explode(",", $entry[0]['dn']);
-				for($i=1; $i<count($sector_dn_array); ++$i)
+                $sector_dn_array_count = count($sector_dn_array);
+				for($i=1; $i<$sector_dn_array_count; ++$i)
 					$sector_dn .= $sector_dn_array[$i] . ',';
 				//Retira ultimo pipe.
Index: /trunk/listAdmin/inc/class.db_functions.inc.php
===================================================================
--- /trunk/listAdmin/inc/class.db_functions.inc.php	(revision 7655)
+++ /trunk/listAdmin/inc/class.db_functions.inc.php	(revision 7673)
@@ -282,6 +282,7 @@
 		while($this->db->next_record())
 			$user_app[] = $this->db->row();
-		
-		for ($i=0; $i<count($user_app); ++$i)
+
+        $user_app_count = count($user_app);
+		for ($i=0; $i<$user_app_count; ++$i)
 			$return['groups'][] = $user_app[$i]['acl_location'];
 		
Index: /trunk/listAdmin/inc/class.ldap_functions.inc.php
===================================================================
--- /trunk/listAdmin/inc/class.ldap_functions.inc.php	(revision 7655)
+++ /trunk/listAdmin/inc/class.ldap_functions.inc.php	(revision 7673)
@@ -746,5 +746,6 @@
 		$entry[0]['dn'] = strtolower($entry[0]['dn']);
 		$sector_dn_array = explode(",", $entry[0]['dn']);
-		for($i=1; $i<count($sector_dn_array); ++$i)
+        $sector_dn_array_count = count($sector_dn_array);
+		for($i=1; $i<$sector_dn_array_count; ++$i)
 			$sector_dn .= $sector_dn_array[$i] . ',';
 		//Retira ultimo pipe.
@@ -844,5 +845,6 @@
 		$entry[0]['dn'] = strtolower($entry[0]['dn']);
 		$sector_dn_array = explode(",", $entry[0]['dn']);
-		for($i=1; $i<count($sector_dn_array); ++$i)
+        $sector_dn_array_count = count($sector_dn_array);
+		for($i=1; $i<$sector_dn_array_count; ++$i)
 			$sector_dn .= $sector_dn_array[$i] . ',';
 		//Retira ultimo pipe.
@@ -925,5 +927,6 @@
 		$entry[0]['dn'] = strtolower($entry[0]['dn']);
 		$sector_dn_array = explode(",", $entry[0]['dn']);
-		for($i=1; $i<count($sector_dn_array); ++$i)
+        $sector_dn_array_count = count($sector_dn_array);
+		for($i=1; $i<$sector_dn_array_count; ++$i)
 			$sector_dn .= $sector_dn_array[$i] . ',';
 		//Retira ultimo pipe.
@@ -1006,5 +1009,6 @@
 		$entry[0]['dn'] = strtolower($entry[0]['dn']);
 		$sector_dn_array = explode(",", $entry[0]['dn']);
-		for($i=1; $i<count($sector_dn_array); ++$i)
+        $sector_dn_array_count = count($sector_dn_array);
+		for($i=1; $i<$sector_dn_array_count; ++$i)
 			$sector_dn .= $sector_dn_array[$i] . ',';
 		//Retira ultimo pipe.
@@ -1086,5 +1090,6 @@
 		$entry[0]['dn'] = strtolower($entry[0]['dn']);
 		$sector_dn_array = explode(",", $entry[0]['dn']);
-		for($i=1; $i<count($sector_dn_array); ++$i)
+        $sector_dn_array_count = count($sector_dn_array);
+		for($i=1; $i<$sector_dn_array_count; ++$i)
 			$sector_dn .= $sector_dn_array[$i] . ',';
 		//Retira ultimo pipe.
Index: /trunk/admin/inc/class.uiaccounts.inc.php
===================================================================
--- /trunk/admin/inc/class.uiaccounts.inc.php	(revision 7655)
+++ /trunk/admin/inc/class.uiaccounts.inc.php	(revision 7673)
@@ -816,5 +816,6 @@
 			@reset($db_perms);
 
-			for ($i=0;$i<count($perm_display);++$i)
+            $perm_display_count = count($perm_display);
+			for ($i=0;$i<$perm_display_count;++$i)
 			{
 				if ($perm_display[$i]['title'])
@@ -955,5 +956,6 @@
 			
 			$tr_color = $GLOBALS['phpgw_info']['theme']['row_off'];
-			for ($i=0;$i < count($perm_display);++$i)
+            $perm_display_count = count($perm_display);
+			for ($i=0;$i < $perm_display_count;++$i)
 			{
 				$app = $perm_display[$i][0];
@@ -1182,5 +1184,6 @@
 			{
 				$groups_select .= '<option value="' . $value['account_id'] . '"';
-				for ($i=0; $i<count($userGroups); ++$i)
+                $userGroups_count = count($userGroups);
+				for ($i=0; $i<$userGroups_count; ++$i)
 				{
 					/* print "Los1:".$userData["account_id"].$userGroups[$i]['account_id']." : ".$value['account_id']."<br>"; */
Index: /trunk/admin/inc/class.uilog.inc.php
===================================================================
--- /trunk/admin/inc/class.uilog.inc.php	(revision 7655)
+++ /trunk/admin/inc/class.uilog.inc.php	(revision 7673)
@@ -63,5 +63,6 @@
 				{
 					$c = array();
-					for ($i=0;$i<count($_cols);++$i)
+                    $cols_count = count($_cols);
+					for ($i=0;$i<$cols_count;++$i)
 					{
 						if (!in_array($i, $_delcol))
Index: /trunk/admin/inc/class.solog.inc.php
===================================================================
--- /trunk/admin/inc/class.solog.inc.php	(revision 7655)
+++ /trunk/admin/inc/class.solog.inc.php	(revision 7673)
@@ -40,5 +40,6 @@
 				/* fields from phpgw_log table */
 				$clist = $this->db->metadata('phpgw_log');
-				for ($i=0; $i<count($clist); ++$i)
+                $clist_count = count($clist);
+				for ($i=0; $i<$clist_count; ++$i)
 				{
 					$name =  $clist[$i]['name'];
@@ -48,5 +49,6 @@
 				/* fields from phpgw_log_msg table */
 				$clist = $this->db->metadata('phpgw_log_msg');
-				for ($i=0; $i<count($clist); ++$i)
+                $clist_count = count($clist);
+				for ($i=0; $i<$clist_count; ++$i)
 				{
 					$name =  $clist[$i]['name'];
@@ -66,5 +68,6 @@
 				/* Enhance with Columns for phpgw_accounts */
 				$clist = $this->db->metadata('phpgw_accounts');
-				for ($i=0; $i<count($clist); ++$i)
+                $clist_count = count($clist);
+				for ($i=0; $i<$clist_count; ++$i)
 				{
 					$name =  $clist[$i]['name'];
Index: /trunk/admin/inc/class.html_tables.inc.php
===================================================================
--- /trunk/admin/inc/class.html_tables.inc.php	(revision 7655)
+++ /trunk/admin/inc/class.html_tables.inc.php	(revision 7673)
@@ -142,5 +142,6 @@
 						$row = $rows[$rno];
 
-						for($pc=0;$pc<count($row);++$pc)
+                        $row_count = count($row);
+						for($pc=0;$pc<$row_count;++$pc)
 						{
 							$c = $row[$cols[$pc]];
Index: /trunk/jabberit_messenger/jmessenger/inc/class.ContactsIm.inc.php
===================================================================
--- /trunk/jabberit_messenger/jmessenger/inc/class.ContactsIm.inc.php	(revision 7655)
+++ /trunk/jabberit_messenger/jmessenger/inc/class.ContactsIm.inc.php	(revision 7673)
@@ -69,6 +69,7 @@
 		
 		if( is_array($users) )
-		{	
-			for($i = 0; $i < count($users); ++$i)
+		{
+            $users_count = count($users);
+			for($i = 0; $i < $users_count; ++$i)
 			{
 				if( is_array($hostsJabber) )
@@ -203,8 +204,10 @@
 
 			$_restrict = array();
-			
-			for( $i = 0 ; $i < count($orgs) ; ++$i )
-			{
-				for( $j = 0 ; $j < count($array_uids) ; ++$j )
+
+            $orgs_count = count($orgs);
+			for( $i = 0 ; $i < $orgs_count; ++$i )
+			{
+                $array_uids_count = count($array_uids);
+				for( $j = 0 ; $j < $array_uids_count; ++$j )
 				{
 					if( trim($array_uids[$j]['ou']) === trim($orgs[$i]) )
@@ -331,6 +334,7 @@
 						$posAll = $this->strallpos($ou_User, "OU=" );
 						$orgs = array();
-				
-						for( $i = 0 ; $i < count($posAll); ++$i )
+
+                        $posAll_count = count($posAll);
+						for( $i = 0 ; $i < $posAll_count; ++$i )
 						{
 							$pos = strpos($ou_User, ",");
@@ -369,6 +373,7 @@
 							$posAll = $this->strallpos($ou_User, "OU=" );
 							$orgs = array();
-					
-							for( $i = 0 ; $i < count($posAll); ++$i )
+
+                            $posAll_count = count($posAll);
+							for( $i = 0 ; $i < $posAll_count; ++$i )
 							{
 								$pos = strpos($ou_User, ",");
Index: /trunk/jabberit_messenger/jmessenger/inc/class.LdapIM.inc.php
===================================================================
--- /trunk/jabberit_messenger/jmessenger/inc/class.LdapIM.inc.php	(revision 7655)
+++ /trunk/jabberit_messenger/jmessenger/inc/class.LdapIM.inc.php	(revision 7673)
@@ -124,6 +124,7 @@
 		{
 			$confHosts	= $this->hostsJabber;
-			
-			for($i = 0; $i < count($confHosts); ++$i )
+
+            $confHosts_count = count($confHosts);
+			for($i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( $pData['serverLdap'] == $confHosts[$i]['serverLdap'] )
@@ -209,6 +210,7 @@
 			{
 				$confHosts	= $this->hostsJabber;
-			
-				for($i = 0; $i < count($confHosts); ++$i )
+
+                $confHosts_count = count($confHosts);
+				for($i = 0; $i < $confHosts_count; ++$i )
 				{
 					if( $this->ldap )
@@ -278,6 +280,7 @@
 		{
 			$confHosts	= $this->hostsJabber;
-		
-			for($i = 0; $i < count($confHosts); ++$i )
+
+            $confHosts_count = count($confHosts);
+			for($i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( $this->ldap )
@@ -321,6 +324,7 @@
 		{
 			$confHosts	= $this->hostsJabber;
-			
-			for($i = 0; $i < count($confHosts); ++$i )
+
+            $confHosts_count = count($confHosts);
+			for($i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( $pLdap_host == $confHosts[$i]['serverLdap'] )
@@ -399,5 +403,6 @@
 			$confHosts	= $this->hostsJabber;	
 
-			for( $i = 0; $i < count($confHosts); ++$i )
+            $confHosts_count = count($confHosts);
+			for( $i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( trim($host) === trim($confHosts[$i]['jabberName']) )
@@ -452,7 +457,8 @@
 		$result = array();
 		$return	= array();
-		$conn	= "";		
-
-		for( $i = 0; $i < count($confHosts); ++$i )
+		$conn	= "";
+
+        $confHosts_count = count($confHosts);
+		for( $i = 0; $i < $confHosts_count; ++$i )
 		{
 			if( $pLdap && $pLdap == $confHosts[$i]['serverLdap'] )
Index: /trunk/jabberit_messenger/jmessenger/inc/class.DataBaseIM.inc.php
===================================================================
--- /trunk/jabberit_messenger/jmessenger/inc/class.DataBaseIM.inc.php	(revision 7655)
+++ /trunk/jabberit_messenger/jmessenger/inc/class.DataBaseIM.inc.php	(revision 7673)
@@ -57,7 +57,8 @@
 		$hostsJabber = unserialize($this->getHostsJabber());
 		$findHosts	= explode(":", $pItem['item']);
-		$return = "";	
-		
-		for( $i = 0 ; $i < count($hostsJabber); ++$i )
+		$return = "";
+
+        $hostsJabber_count = count($hostsJabber);
+		for( $i = 0 ; $i < $hostsJabber_count; ++$i )
 			if( $hostsJabber[$i]['org'] == $findHosts[0] && $hostsJabber[$i]['jabberName'] == $findHosts[1] )
 			{
@@ -490,5 +491,6 @@
 		$orgs = array();
 
-		for( $i = 0 ; $i < count($posAll); ++$i )
+        $posAll_count = count($posAll);
+		for( $i = 0 ; $i < $posAll_count; ++$i )
 		{
 			$pos = strpos($organization, ",");
@@ -628,5 +630,6 @@
 					if( count($confHostsOrgs) > 0 )
 					{
-						for( $i = 0; $i < count($confHostsOrgs); ++$i)
+                        $confHostsOrgs_count = count($confHostsOrgs);
+						for( $i = 0; $i < $confHostsOrgs_count; ++$i)
 							if( $confHostsOrgs[$i]['org'] == $hosts[0] && $confHostsOrgs[$i]['jabberName'] == $hosts[1])
 								$key = $i;	
Index: /trunk/jabberit_messenger/inc/login.php
===================================================================
--- /trunk/jabberit_messenger/inc/login.php	(revision 7655)
+++ /trunk/jabberit_messenger/inc/login.php	(revision 7673)
@@ -86,7 +86,8 @@
 		
 		if( $voip_enabled )
-			$pluginsJava[] = "callVoip.jar";		
-		
-		for( $i = 0; $i < count($pluginsJava); ++$i )
+			$pluginsJava[] = "callVoip.jar";
+
+        $pluginsJava_count = count($pluginsJava);
+		for( $i = 0; $i < $pluginsJava_count; ++$i )
 		{
 			$javaFiles	 .= $path . "plugins/" . $pluginsJava[$i] . ",";
Index: /trunk/jabberit_messenger/inc/class.contacts_im.inc.php
===================================================================
--- /trunk/jabberit_messenger/inc/class.contacts_im.inc.php	(revision 7655)
+++ /trunk/jabberit_messenger/inc/class.contacts_im.inc.php	(revision 7673)
@@ -92,6 +92,7 @@
 
 		if( is_array($users) )
-		{	
-			for($i = 0; $i < count($users); ++$i)
+		{
+            $users_count = count($users);
+			for($i = 0; $i < $users_count; ++$i)
 			{
 				if( is_array($hostsJabber) )
@@ -225,8 +226,10 @@
 
 			$_restrict = array();
-			
-			for( $i = 0 ; $i < count($orgs) ; ++$i )
-			{
-				for( $j = 0 ; $j < count($array_uids) ; ++$j )
+
+            $orgs_count = count($orgs);
+			for( $i = 0 ; $i < $orgs_count; ++$i )
+			{
+                $array_uids_count = count($array_uids);
+				for( $j = 0 ; $j < $array_uids_count; ++$j )
 				{
 					if( trim($array_uids[$j]['ou']) === trim($orgs[$i]) )
@@ -331,6 +334,7 @@
 						$posAll = $this->strallpos($ou_User, "OU=" );
 						$orgs = array();
-				
-						for( $i = 0 ; $i < count($posAll); ++$i )
+
+                        $posAll_count = count($posAll);
+						for( $i = 0 ; $i < $posAll_count; ++$i )
 						{
 							$pos = strpos($ou_User, ",");
@@ -369,6 +373,7 @@
 							$posAll = $this->strallpos($ou_User, "OU=" );
 							$orgs = array();
-					
-							for( $i = 0 ; $i < count($posAll); ++$i )
+
+                            $posAll_count = count($posAll);
+							for( $i = 0 ; $i < $posAll_count; ++$i )
 							{
 								$pos = strpos($ou_User, ",");
Index: /trunk/jabberit_messenger/inc/class.ldap_im.inc.php
===================================================================
--- /trunk/jabberit_messenger/inc/class.ldap_im.inc.php	(revision 7655)
+++ /trunk/jabberit_messenger/inc/class.ldap_im.inc.php	(revision 7673)
@@ -125,6 +125,7 @@
 		{
 			$confHosts	= $this->hostsJabber;
-			
-			for($i = 0; $i < count($confHosts); ++$i )
+
+            $confHosts_count = count($confHosts);
+			for($i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( $pData['serverLdap'] == $confHosts[$i]['serverLdap'] )
@@ -210,6 +211,7 @@
 			{
 				$confHosts	= $this->hostsJabber;
-			
-				for($i = 0; $i < count($confHosts); ++$i )
+
+                $confHosts_count = count($confHosts);
+				for($i = 0; $i < $confHosts_count; ++$i )
 				{
 					if( $this->ldap )
@@ -279,6 +281,7 @@
 		{
 			$confHosts	= $this->hostsJabber;
-		
-			for($i = 0; $i < count($confHosts); ++$i )
+
+            $confHosts_count = count($confHosts);
+			for($i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( $this->ldap )
@@ -322,6 +325,7 @@
 		{
 			$confHosts	= $this->hostsJabber;
-			
-			for($i = 0; $i < count($confHosts); ++$i )
+
+            $confHosts_count = count($confHosts);
+			for($i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( $pLdap_host == $confHosts[$i]['serverLdap'] )
@@ -396,7 +400,8 @@
 		$result = array();
 		$return	= array();
-		$conn	= "";		
-
-		for( $i = 0; $i < count($confHosts); ++$i )
+		$conn	= "";
+
+        $confHosts_count = count($confHosts);
+		for( $i = 0; $i < $confHosts_count; ++$i )
 		{
 			if( $pLdap && $pLdap == $confHosts[$i]['serverLdap'] )
Index: /trunk/jabberit_messenger/inc/class.db_im.inc.php
===================================================================
--- /trunk/jabberit_messenger/inc/class.db_im.inc.php	(revision 7655)
+++ /trunk/jabberit_messenger/inc/class.db_im.inc.php	(revision 7673)
@@ -58,7 +58,8 @@
 		$hostsJabber = unserialize($this->getHostsJabber());
 		$findHosts	= explode(":", $pItem['item']);
-		$return = "";	
-		
-		for( $i = 0 ; $i < count($hostsJabber); ++$i )
+		$return = "";
+
+        $hostsJabber_count = count($hostsJabber);
+		for( $i = 0 ; $i < $hostsJabber_count; ++$i )
 			if( $hostsJabber[$i]['org'] == $findHosts[0] && $hostsJabber[$i]['jabberName'] == $findHosts[1] )
 			{
@@ -517,5 +518,6 @@
 		$orgs = array();
 
-		for( $i = 0 ; $i < count($posAll); ++$i )
+        $posAll_count = count($posAll);
+		for( $i = 0 ; $i < $posAll_count; ++$i )
 		{
 			$pos = strpos($organization, ",");
@@ -655,5 +657,6 @@
 					if( count($confHostsOrgs) > 0 )
 					{
-						for( $i = 0; $i < count($confHostsOrgs); ++$i)
+                        $confHostsOrgs_count = count($confHostsOrgs);
+						for( $i = 0; $i < $confHostsOrgs_count; ++$i)
 							if( $confHostsOrgs[$i]['org'] == $hosts[0] && $confHostsOrgs[$i]['jabberName'] == $hosts[1])
 								$key = $i;	
Index: /trunk/contactcenter/inc/class.bo_ldap_manager.inc.php
===================================================================
--- /trunk/contactcenter/inc/class.bo_ldap_manager.inc.php	(revision 7655)
+++ /trunk/contactcenter/inc/class.bo_ldap_manager.inc.php	(revision 7673)
@@ -438,6 +438,7 @@
 			$referral = $this -> get_ldap_referrals($ds, $dn, $filter);
 			$sub_branches = array();
-			
-			for($i = 0; $i <count($referral); ++$i) {
+
+            $referral_count = count($referral);
+			for($i = 0; $i <$referral_count; ++$i) {
 				$dn = str_replace("??base","",preg_replace('!^(ldap://[^/]+)/(.*$)!', '\\2', $referral[$i]));
 				$dn = explode(",",$dn);				
Index: /trunk/contactcenter/inc/class.ui_data.inc.php
===================================================================
--- /trunk/contactcenter/inc/class.ui_data.inc.php	(revision 7655)
+++ /trunk/contactcenter/inc/class.ui_data.inc.php	(revision 7673)
@@ -2118,5 +2118,6 @@
 
                         $actualCatalog = $this->get_actual_catalog();
-                        for ($i = 0; $i < count($data['contact_in_list']); ++$i)
+                        $data_count = count($data['contact_in_list']);
+                        for ($i = 0; $i < $data_count; ++$i)
                         {
                             if (preg_match('/ldap:.*:.*/', $data['contact_in_list'][$i])) // from ldap
@@ -3789,5 +3790,6 @@
 			$contact['names_ordered'] = $info[0]['description'];
 			$filter = "";
-			for($z = 0; $z < count($member_uids); ++$z) {
+            $member_uids_count = count($member_uids);
+			for($z = 0; $z < $member_uids_count; ++$z) {
 				if($member_uids[$z])
 					$filter.="(uid=".$member_uids[$z].")";
@@ -4806,5 +4808,6 @@
 			if ($info)
 			{
-				for ($i = 0; $i < count($justThese); ++$i)
+                $justThese_count = count($justThese);
+				for ($i = 0; $i < $justThese_count; ++$i)
 				{
 					$attr = array();
Index: /trunk/emailadmin/inc/class.ui.inc.php
===================================================================
--- /trunk/emailadmin/inc/class.ui.inc.php	(revision 7655)
+++ /trunk/emailadmin/inc/class.ui.inc.php	(revision 7673)
@@ -240,5 +240,6 @@
 			if ($profileList)
 			{
-				for ($i=0; $i < count($profileList); ++$i)
+                $profileList_count = count($profileList);
+				for ($i=0; $i < $profileList_count; ++$i)
 				{
 					$linkData = array
Index: /trunk/emailadmin/inc/class.uiuserdata.inc.php
===================================================================
--- /trunk/emailadmin/inc/class.uiuserdata.inc.php	(revision 7655)
+++ /trunk/emailadmin/inc/class.uiuserdata.inc.php	(revision 7673)
@@ -78,5 +78,6 @@
 				{
 					$options_mailAlternateAddress = "<select size=\"6\" name=\"mailAlternateAddress\">\n";
-					for ($i=0;$i < count($userData['mailAlternateAddress']); ++$i)
+                    $userData_count = count($userData['mailAlternateAddress']);
+					for ($i=0;$i < $userData_count; ++$i)
 					{
 						$options_mailAlternateAddress .= "<option value=\"$i\">".
@@ -94,5 +95,6 @@
 				{
 					$options_mailRoutingAddress = "<select size=\"6\" name=\"mailRoutingAddress\">\n";
-					for ($i=0;$i < count($userData['mailRoutingAddress']); ++$i)
+                    $userData_count = count($userData['mailRoutingAddress']);
+					for ($i=0;$i < $userData_count; ++$i)
 					{
 						$options_mailRoutingAddress .= "<option value=\"$i\">".
Index: /trunk/setup/ldapimport.php
===================================================================
--- /trunk/setup/ldapimport.php	(revision 7655)
+++ /trunk/setup/ldapimport.php	(revision 7673)
@@ -216,5 +216,6 @@
 						// This is typically an exception to apps for run rights
 						//  as a group member.
-						for($a=0;$a<count($admins);++$a)
+                        $admins_count = count($admins);
+						for($a=0;$a<$admins_count;++$a)
 						{
 							if($admins[$a] == $thisacctlid)
Index: /trunk/preferences/inc/class.uiaclprefs.inc.php
===================================================================
--- /trunk/preferences/inc/class.uiaclprefs.inc.php	(revision 7655)
+++ /trunk/preferences/inc/class.uiaclprefs.inc.php	(revision 7673)
@@ -112,6 +112,7 @@
 					}
 				}
-				
-				for($i=0;$i<count($to_remove);++$i) {
+
+				$to_remove_count = count($to_remove);
+				for($i=0;$i<$to_remove_count;++$i) {
 					
 					if(!array_key_exists((int)$to_remove[$i],$keys_to_keep)) {
Index: /trunk/preferences/inc/class.uicategories.inc.php
===================================================================
--- /trunk/preferences/inc/class.uicategories.inc.php	(revision 7655)
+++ /trunk/preferences/inc/class.uicategories.inc.php	(revision 7673)
@@ -83,5 +83,6 @@
 		function cat_data($edata,$data)
 		{
-			for ($j=0;$j<count($edata);++$j)
+            $edata_count = count($edata);
+			for ($j=0;$j<$edata_count;++$j)
 			{
 				$td_data .= '<td>' . $data[$edata[$j]] . '</td>' . "\n";
@@ -169,5 +170,6 @@
 			if (is_array($edata))
 			{
-				for($i=0;$i<count($edata);++$i)
+                $edata_count = count($edata);
+				for($i=0;$i<$edata_count;++$i)
 				{
 					$GLOBALS['phpgw']->template->set_var('th_data','<td bgcolor="' . $GLOBALS['phpgw_info']['theme']['th_bg'] . '">' . lang($edata[$i]) . '</td>');
@@ -181,6 +183,6 @@
 
 // -------------------------- end header declaration --------------------------------------
-
-			for ($i=0;$i<count($cats);++$i)
+            $cats_count = count($cats);
+			for ($i=0;$i<$cats_count;++$i)
 			{
 				$this->nextmatchs->template_alternate_row_color($GLOBALS['phpgw']->template);
@@ -375,5 +377,6 @@
 			{
 				$edata = explode(',',$extra);
-				for($i=0;$i<count($edata);++$i)
+                $edata_count = count($edata);
+				for($i=0;$i<$edata_count;++$i)
 				{
 					$GLOBALS['phpgw']->template->set_var('tr_color',$GLOBALS['phpgw']->nextmatchs->alternate_row_color());
@@ -506,5 +509,6 @@
 
 				$data = unserialize($cats[0]['data']);
-				for($i=0;$i<count($edata);++$i)
+                $edata_count = count($edata);
+				for($i=0;$i<$edata_count;++$i)
 				{
 					$GLOBALS['phpgw']->template->set_var('td_data','<input name="cat_data[' . $edata[$i] . ']" size="50" value="' . $data[$edata[$i]] . '">');
Index: /trunk/prototype/services/PostgreSQL.php
===================================================================
--- /trunk/prototype/services/PostgreSQL.php	(revision 7655)
+++ /trunk/prototype/services/PostgreSQL.php	(revision 7673)
@@ -358,6 +358,6 @@
             $orderDesc = array( $orderDesc );
         }
-
-        for($i=0; $i<count($order); ++$i){
+        $order_count = count($order);
+        for($i=0; $i<$order_count; ++$i){
             $order[$i] .= ($orderDesc[$i] === true) ? ' DESC' : '';
         }
Index: /trunk/prototype/services/ImapServiceAdapter.php
===================================================================
--- /trunk/prototype/services/ImapServiceAdapter.php	(revision 7655)
+++ /trunk/prototype/services/ImapServiceAdapter.php	(revision 7673)
@@ -171,13 +171,14 @@
 					if( $filter[0] !== 'msgNumber' )
 					{
-					for( $i = 0; $i < count($filter); ++$i )
-					{
-						if( count( $filter[$i] ) === 4 )
-						$criteria['isExact'] = ( array_shift( $filter[$i] ) === 'AND' );
-
-						$criteria[ $filter[$i][0] ] = array( 'criteria' => $filter[$i][2], 'filter' => $filter[$i][1] );
-					}
-
-					return $this->searchSieveRule($criteria);
+                        $filter_count = count($filter);
+                        for( $i = 0; $i < $filter_count; ++$i )
+                        {
+                            if( count( $filter[$i] ) === 4 )
+                            $criteria['isExact'] = ( array_shift( $filter[$i] ) === 'AND' );
+
+                            $criteria[ $filter[$i][0] ] = array( 'criteria' => $filter[$i][2], 'filter' => $filter[$i][1] );
+                        }
+
+                        return $this->searchSieveRule($criteria);
 					}
 
@@ -188,5 +189,5 @@
 
 					if( empty( $msgNumber ) )
-					return( false );
+					    return( false );
 
 					$result = $this->get_info_msgs( array( 'folder' => $folder_name, 
@@ -213,6 +214,6 @@
 
 				$response = array( "page" => $page, "total" => $total_pages, "records" => $count );
-				
-				for ($i=0; $i<count($result); ++$i)
+				$result_count = count($result);
+				for ($i=0; $i<$result_count; ++$i)
 				{
 					$flags_enum = array('Unseen'=> 1,  'Answered'=> 1, 'Forwarded'=> 1, 'Flagged'=> 1, 'Recent'=> 1, 'Draft'=> 1 ); 
Index: /trunk/prototype/modules/catalog/interceptors/CatalogDBMapping.php
===================================================================
--- /trunk/prototype/modules/catalog/interceptors/CatalogDBMapping.php	(revision 7655)
+++ /trunk/prototype/modules/catalog/interceptors/CatalogDBMapping.php	(revision 7673)
@@ -23,5 +23,6 @@
 
 		if(count($params)>0 && isset($params[0]['id'])){
-			for($i=0; $i < count($params); ++$i){
+            $params_count = count($params);
+			for($i=0; $i < $params_count; ++$i){
 				//Retorna o telefone e o e-mail padrao de um determinado contato
 				$sql = ' SELECT phpgw_cc_contact_conns.id_typeof_contact_connection as type, phpgw_cc_connections.connection_value as value '
Index: /trunk/security/classes/funcoes_auxiliares.php
===================================================================
--- /trunk/security/classes/funcoes_auxiliares.php	(revision 7655)
+++ /trunk/security/classes/funcoes_auxiliares.php	(revision 7673)
@@ -242,5 +242,6 @@
 		$n = 0;
 		$b = 0;
-		for($n = 0; $n < count($partes); ++$n)
+        $partes_count = count($partes);
+		for($n = 0; $n < $partes_count; ++$n)
 		{
 			if($n==0)
@@ -1498,5 +1499,6 @@
 		if(count($partes)>1)
 			{
-				for($i=1;$i<count($partes);++$i)
+                $partes_count = count($partes);
+				for($i=1;$i<$partes_count;++$i)
 					{
 					        //O inicio da seq pode estar a 3 ou 2 digitos antes do inicio da oid .... depende do numero de bytes usados para  tamanho da seq.
@@ -1580,5 +1582,6 @@
 		$esta_oid = $oids[$oid];
 		$p = 0;
-		for($i=1;$i < count($esta_oid) + 1; ++$i)
+        $esta_oid_count = count($esta_oid);
+		for($i=1;$i < $esta_oid_count + 1; ++$i)
 			{
 				if($esta_oid[$i][1] == 0)
Index: /trunk/calendar/inc/class.bocalendar.inc.php
===================================================================
--- /trunk/calendar/inc/class.bocalendar.inc.php	(revision 7655)
+++ /trunk/calendar/inc/class.bocalendar.inc.php	(revision 7673)
@@ -1252,5 +1252,6 @@
 					$minparts = min($l_participants);
 					$part = Array();
-					for($i=0;$i<count($parts);++$i)
+                    $parts_count = count($parts);
+					for($i=0;$i<$parts_count;++$i)
 					{
 						if (($accept_type = substr($parts[$i],-1,1)) == '0' || (int)$accept_type > 0)
@@ -2137,5 +2138,6 @@
 			{
 				$exceptions = explode(',',$exception_str);
-				for($exception_count=0;$exception_count<count($exceptions);++$exception_count)
+                $exceptions_count = count($exceptions);
+				for($exception_count=0;$exception_count<$exceptions_count;++$exception_count)
 				{
 					$exception[] = (int)$exceptions[$exception_count];
@@ -2196,5 +2198,6 @@
 				}
 
-				for($i=0;$i<count($this->cached_events[$date]);++$i)
+                $cached_events_count = count($this->cached_events[$date]);
+				for($i=0;$i<$cached_events_count;++$i)
 				{
 					if($this->cached_events[$date][$i]['id'] == $event['id'] || $this->cached_events[$date][$i]['reference'] == $event['id'])
@@ -2575,5 +2578,6 @@
 					{
 						echo '<!-- Total events found matching '.$search_date.' = '.count($this->cached_events[$search_date]).' -->'."\n";
-						for($i=0;$i<count($this->cached_events[$search_date]);++$i)
+                        $cached_events_count = count($this->cached_events[$search_date]);
+						for($i=0;$i<$cached_events_count;++$i)
 						{
 							echo '<!-- Date: '.$search_date.' ['.$i.'] = '.$this->cached_events[$search_date][$i]['id'].' -->'."\n";
@@ -2866,5 +2870,6 @@
 
 			//verifica se todos os participantes rejeitaram o evento
-			for($i = 0; $i < count($sts); ++$i ){
+            $sts_count = count($sts);
+			for($i = 0; $i < $sts_count; ++$i ){
 				if( $sts[i] === "R")
 					unset( $sts[i] );
@@ -4436,5 +4441,6 @@
 			{
 				$cal_grps = '';
-				for($i=0;$i<count($event['groups']);++$i)
+                $event_groups_count = count($event['groups']);
+				for($i=0;$i<$event_groups_count;++$i)
 				{
 					if($GLOBALS['phpgw']->accounts->exists($event['groups'][$i]))
Index: /trunk/calendar/inc/class.boicalendar.inc.php
===================================================================
--- /trunk/calendar/inc/class.boicalendar.inc.php	(revision 7655)
+++ /trunk/calendar/inc/class.boicalendar.inc.php	(revision 7673)
@@ -1434,5 +1434,6 @@
 			//$this->debug('parse_parameters array return_value: '._debug_array($return_value,False));
 
-		for ($i = 0; $i < count($return_value); ++$i) {
+        $return_value_count = count($return_value);
+		for ($i = 0; $i < $return_value_count; ++$i) {
 				$name = strtolower($return_value[$i]['param']);
 				$value = $this->strip_quotes($return_value[$i]['value']);
@@ -1661,5 +1662,6 @@
 					if (!empty ($event[$value])) {
 						if ($multiples && $value != 'exdate') {
-							for ($i = 0; $i < count($event[$value]); ++$i) {
+                            $event_value_count = count($event[$value]);
+							for ($i = 0; $i < $event_value_count; ++$i) {
 								$str .= $this->fold(strtoupper(str_replace('_', '-', $value)) . $this->build_parameters($event[$value][$i], $value));
 								}
@@ -1674,5 +1676,6 @@
 				case 'uri' :
 					if (!empty ($event[$value])) {
-						for ($i = 0; $i < count($event[$value]); ++$i) {
+                        $event_value_count = count($event[$value]);
+						for ($i = 0; $i < $event_value_count; ++$i) {
 							$str .= $this->fold(strtoupper(str_replace('_', '-', $value)) . $this->build_parameters($event[$value][$i], $to_text));
 							}
@@ -1682,5 +1685,6 @@
 					if (!empty ($event[$value])) {
 						if ($multiples) {
-							for ($i = 0; $i < count($event[$value]); ++$i) {
+                            $event_value_count = count($event[$value]);
+							for ($i = 0; $i < $event_value_count; ++$i) {
 								$str .= $this->fold(strtoupper(str_replace('_', '-', $value)) . $this->build_parameters($event[$value][$i], $value));
 							}
@@ -1712,5 +1716,6 @@
 						if (@ $this->parameter[$key]['type'] != 'function') {
 							if ($multiples && count($event[$value]) > 1) {
-								for ($i = 0; $i < count($event[$value]); ++$i) {
+                                $event_value_count = count($event[$value]);
+								for ($i = 0; $i < $event_value_count; ++$i) {
 									$str .= $this->fold(strtoupper(str_replace('_', '-', $value)) . $this->build_parameters($event[$value][$i], $value));
 								}
@@ -1721,5 +1726,6 @@
 								$function = $this->parameter[$value]['function'];
 							if ($multiples) {
-								for ($i = 0; $i < count($event[$value]); ++$i) {
+                                $event_value_count = count($event[$value]);
+								for ($i = 0; $i < $event_value_count; ++$i) {
 									$str .= $this->fold(strtoupper(str_replace('_', '-', $value)) . ':' . $this-> $function ($event[$value][$i]));
 								}
@@ -1732,5 +1738,6 @@
 				case 'cal-address' :
 					if (is_array($event[$value][0])) {
-						for ($j = 0; $j < count($event[$value]); ++$j) {
+                        $event_value_count = count($event[$value]);
+						for ($j = 0; $j < $event_value_count; ++$j) {
 							$temp_output = $this->build_parameters($event[$value][$j], $value);
 							if ($temp_output) {
@@ -1748,5 +1755,6 @@
 			}
 		if (!empty ($event['x_type'])) {
-			for ($i = 0; $i < count($event['x_type']); ++$i) {
+            $event_x_type_count = count($event['x_type']);
+			for ($i = 0; $i < $event_x_type_count; ++$i) {
 				$str .= $this->build_xtype($event['x_type'][$i], ':');
 				}
@@ -1755,5 +1763,6 @@
 		if ($ical_item == 'vtimezone') {
 			if ($event['tzdata']) {
-				for ($k = 0; $k < count($event['tzdata']); ++$k) {
+                $event_tzdata_count = count($event['tzdata']);
+				for ($k = 0; $k < $event_tzdata_count; ++$k) {
 					$str .= 'BEGIN:' . strtoupper($event['tzdata'][$k]['type']) . "\r\n";
 					$str .= $this->build_card_internals(strtolower($event['tzdata'][$k]['type']), $event['tzdata'][$k]);
@@ -1763,5 +1772,6 @@
 			}
 		elseif ($event['alarm']) {
-			for ($k = 0; $k < count($event['alarm']); ++$k) {
+            $event_alarm_count = count($event['alarm']);
+			for ($k = 0; $k < $event_alarm_count; ++$k) {
 				$str .= 'BEGIN:VALARM' . "\r\n";
 				$str .= $this->build_card_internals('valarm', $event['alarm'][$k]);
Index: /trunk/calendar/inc/class.socalendar_sql.inc.php
===================================================================
--- /trunk/calendar/inc/class.socalendar_sql.inc.php	(revision 7655)
+++ /trunk/calendar/inc/class.socalendar_sql.inc.php	(revision 7673)
@@ -597,5 +597,6 @@
 				{
 					$groups = explode(',',$this->stream->f('groups'));
-					for($j=1;$j<count($groups) - 1;++$j)
+                    $groups_count = count($groups) - 1;
+					for($j=1;$j<$groups_count;++$j)
 					{
 						$this->add_attribute('groups',$groups[$j],$j-1);
Index: /trunk/calendar/inc/class.uipublicview.inc.php
===================================================================
--- /trunk/calendar/inc/class.uipublicview.inc.php	(revision 7655)
+++ /trunk/calendar/inc/class.uipublicview.inc.php	(revision 7673)
@@ -521,5 +521,6 @@
 
 			$description = $this->bo->get_short_field($event,$is_private,'description');
-			for($i=0;$i<count($picture);++$i)
+            $picture_count = count($picture);
+			for($i=0;$i<$picture_count;++$i)
 			{
 				$var = Array(
@@ -946,5 +947,6 @@
 				if($holidays)
 				{
-					for($k=0;$k<count($holidays);++$k)
+                    $holidays_count = count($holidays);
+					for($k=0;$k<$holidays_count;++$k)
 					{
 						$holiday_name[] = $holidays[$k]['name'];
Index: /trunk/calendar/inc/class.uicalendar.inc.php
===================================================================
--- /trunk/calendar/inc/class.uicalendar.inc.php	(revision 7655)
+++ /trunk/calendar/inc/class.uicalendar.inc.php	(revision 7673)
@@ -328,5 +328,6 @@
 					);
 				}
-				for($l=0;$l<count($var);++$l)
+                $var_count = count($var);
+				for($l=0;$l<$var_count;++$l)
 				{
 					$this->output_template_array($mini_cal_tpl,'monthweek_day','mini_day',$var[$l]);
@@ -1331,5 +1332,6 @@
 			$str = '';
 
-			for($i=0;$i<count($event['recur_exception']);++$i)
+            $event_count = count($event['recur_exception']);
+			for($i=0;$i<$event_count;++$i)
 			{
 				$str .= '    <option value="'.$i.'">'.$GLOBALS['phpgw']->common->show_date($event['recur_exception'][$i]).'</option>'."\n";
@@ -1457,5 +1459,6 @@
 				// Add participants
 				$participants = explode(";", $GLOBALS['phpgw']->session->appsession("participants") );
-				for($_f_part=0; $_f_part<count($participants); ++$_f_part)
+                $participants_count = count($participants);
+				for($_f_part=0; $_f_part<$participants_count; ++$_f_part)
 				{
 					$this->bo->add_attribute('participants','A',$participants[$_f_part]);
@@ -2809,5 +2812,6 @@
 			$accounts = $GLOBALS['phpgw']->acl->get_ids_for_location('run',1,'calendar');
 			$users = Array();
-			for($i=0;$i<count($accounts);++$i)
+            $accounts_count = count($accounts);
+			for($i=0;$i<$accounts_count;++$i)
 			{
 				$user = $accounts[$i];
@@ -2820,5 +2824,6 @@
 						if($group_members != False)
 						{
-							for($j=0;$j<count($group_members);++$j)
+                            $group_members_count = count($group_members);
+							for($j=0;$j<$group_members_count;++$j)
 							{
 								if(!isset($users[$group_members[$j]]))
@@ -2861,5 +2866,6 @@
 			);
 
-			for($i=0;$i<count($var);++$i)
+            $var_count = count($var);
+			for($i=0;$i<$var_count;++$i)
 			{
 				$this->output_template_array($p,'rows','list',$var[$i]);
@@ -3607,5 +3613,6 @@
 
 			$description = $this->bo->get_short_field($event,$is_private,'description');
-			for($i=0;$i<count($picture);++$i)
+            $picture_count = count($picture);
+			for($i=0;$i<$picture_count;++$i)
 			{
 				$var = Array(
@@ -3797,5 +3804,6 @@
 
 			$description = $this->bo->get_short_field($event,$is_private,'description');
-			for($i=0;$i<count($picture);++$i)
+            $picture_count = count($picture);
+			for($i=0;$i<$picture_count;++$i)
 			{
 				$var = Array(
@@ -3868,5 +3876,6 @@
 
 			$overlap = '';
-			for($i=0;$i<count($overlapping_events);++$i)
+            $overlapping_events_count = count($overlapping_events);
+			for($i=0;$i<$overlapping_events_count;++$i)
 			{
 				$overlapped_event = $this->bo->read_entry($overlapping_events[$i],True);
@@ -5734,5 +5743,6 @@
 			}
 
-			for ($i=0; $i<count($control_data['part']); ++$i)
+            $control_data_count = count($control_data['part']);
+			for ($i=0; $i<$control_data_count; ++$i)
 			{
 				$id = $control_data['part'][$i];
@@ -5745,5 +5755,6 @@
 			if ($control_data['action'] == lang('Delete selected contacts'))
 			{
-				for ($i=0; $i<count($control_data['delete']); ++$i)
+                $control_data_count = count($control_data['delete']);
+				for ($i=0; $i<$control_data_count; ++$i)
 				{
 					$id = $control_data['delete'][$i];
@@ -5970,5 +5981,6 @@
 				if($holidays)
 				{
-					for($k=0;$k<count($holidays);++$k)
+                    $holidays_count = count($holidays);
+					for($k=0;$k<$holidays_count;++$k)
 					{
 						$holiday_name[] = $holidays[$k]['name'];
Index: /trunk/calendar/inc/class.boholiday.inc.php
===================================================================
--- /trunk/calendar/inc/class.boholiday.inc.php	(revision 7655)
+++ /trunk/calendar/inc/class.boholiday.inc.php	(revision 7673)
@@ -364,5 +364,6 @@
 		{
 			$new_holidays = Array();
-			for($i=0;$i<count($holidays);++$i)
+            $holidays_count = count($holidays);
+			for($i=0;$i<$holidays_count;++$i)
 			{
 //	echo "Setting Holidays Date : ".date('Ymd',$holidays[$i]['date'])."<br>\n";
@@ -386,5 +387,6 @@
 
 			$temp_locale = $GLOBALS['phpgw_info']['user']['preferences']['common']['country'];
-			for($i=0;$i<count($holidays);++$i)
+            $holidays_count = count($holidays);
+			for($i=0;$i<$holidays_count;++$i)
 			{
 				$c = $i;
Index: /trunk/calendar/inc/class.socalendar.inc.php
===================================================================
--- /trunk/calendar/inc/class.socalendar.inc.php	(revision 7655)
+++ /trunk/calendar/inc/class.socalendar.inc.php	(revision 7673)
@@ -179,5 +179,6 @@
 			$events = $this->list_events($startYear,$startMonth,$startDay,$endYear,$endMonth,$endDay);
 			$events_cached = Array();
-			for($i=0;$i<count($events);++$i)
+            $events_count = count($events);
+			for($i=0;$i<$events_count;++$i)
 			{
 				$events_cached[] = $this->read_entry($events[$i]);
Index: /trunk/calendar/templates/default/header.inc.php
===================================================================
--- /trunk/calendar/templates/default/header.inc.php	(revision 7655)
+++ /trunk/calendar/templates/default/header.inc.php	(revision 7673)
@@ -105,5 +105,6 @@
 		if(isset($GLOBALS['HTTP_POST_VARS']['participants']) && $GLOBALS['HTTP_POST_VARS']['participants'])
 		{
-			for ($i=0;$i<count($GLOBALS['HTTP_POST_VARS']['participants']);++$i)
+            $globals_count = count($GLOBALS['HTTP_POST_VARS']['participants']);
+			for ($i=0;$i<$globals_count;++$i)
 			{
 				$base_hidden_vars .= '    <input type="hidden" name="participants[]" value="'.$GLOBALS['HTTP_POST_VARS']['participants'][$i].'">'."\n";
Index: /trunk/workflow/inc/class.so_orgchart.inc.php
===================================================================
--- /trunk/workflow/inc/class.so_orgchart.inc.php	(revision 7655)
+++ /trunk/workflow/inc/class.so_orgchart.inc.php	(revision 7673)
@@ -152,5 +152,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
 				unset($output[$i][$j]);
@@ -385,5 +386,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
 				unset($output[$i][$j]);
@@ -462,5 +464,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
 				unset($output[$i][$j]);
@@ -541,5 +544,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
 				unset($output[$i][$j]);
@@ -623,5 +627,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i){
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i){
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
 				unset($output[$i][$j]);
@@ -714,5 +719,6 @@
 		$cachedLDAP = Factory::newInstance('CachedLDAP');
 		$cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP_DATABASE);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 		{
 			$output[$i]['funcionario_id_desc'] = '';
@@ -790,5 +796,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 		{
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
@@ -1003,5 +1010,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 		{
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
@@ -1384,5 +1392,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
 				unset($output[$i][$j]);
@@ -1586,5 +1595,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i) {
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i) {
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
 				unset($output[$i][$j]);
Index: /trunk/workflow/inc/class.utils.security.php
===================================================================
--- /trunk/workflow/inc/class.utils.security.php	(revision 7655)
+++ /trunk/workflow/inc/class.utils.security.php	(revision 7673)
@@ -68,6 +68,10 @@
 	function SecurityUtils($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) {
 		// make sure user defined arrays are in lowercase
-		for ($i = 0; $i < count($tagsArray); ++$i) $tagsArray[$i] = strtolower($tagsArray[$i]);
-		for ($i = 0; $i < count($attrArray); ++$i) $attrArray[$i] = strtolower($attrArray[$i]);
+        $tagsArray_count = count($tagsArray);
+		for ($i = 0; $i < $tagsArray_count; ++$i)
+            $tagsArray[$i] = strtolower($tagsArray[$i]);
+        $attrArray_count = count($attrArray);
+		for ($i = 0; $i < $attrArray_count; ++$i)
+            $attrArray[$i] = strtolower($attrArray[$i]);
 		// assign to member vars
 		$this->tagsArray = (array) $tagsArray;
@@ -135,5 +139,6 @@
 		$newSet = array();
 		// process attributes
-		for ($i = 0; $i <count($attrSet); ++$i) {
+        $attrSet_count = count($attrSet);
+		for ($i = 0; $i < $attrSet_count; ++$i) {
 			// skip blank spaces in tag
 			if (!$attrSet[$i]) continue;
Index: /trunk/workflow/inc/class.BrowserInfo.inc.php
===================================================================
--- /trunk/workflow/inc/class.BrowserInfo.inc.php	(revision 7655)
+++ /trunk/workflow/inc/class.BrowserInfo.inc.php	(revision 7673)
@@ -304,5 +304,6 @@
 		$required = explode('.', $version);
 		$current = explode('.', $this->getBrowserVersion());
-		for ($i = 0; $i < count($required); ++$i)
+        $required_count = count($required);
+		for ($i = 0; $i < $required_count; ++$i)
 		{
 			$subRequired = (int) $required[$i];
Index: /trunk/workflow/inc/class.so_userinterface.inc.php
===================================================================
--- /trunk/workflow/inc/class.so_userinterface.inc.php	(revision 7655)
+++ /trunk/workflow/inc/class.so_userinterface.inc.php	(revision 7673)
@@ -123,5 +123,6 @@
 
 			/* keep only associative elments and check if the user can access an intranet application */
-			for ($i = 0; $i < count($preOutput); ++$i)
+            $preOutput_count = count($preOutput);
+			for ($i = 0; $i < $preOutput_count; ++$i)
 			{
 				if (($preOutput[$i]['intranet_only'] == '1') && (!$showIntranetApplications))
@@ -169,5 +170,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
 				unset($output[$i][$j]);
@@ -196,5 +198,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 		{
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
@@ -218,5 +221,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
 				unset($output[$i][$j]);
@@ -296,5 +300,6 @@
 		$cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_NORMAL);
 		$categoriesCount = array();
-		for ($i = 0; $i < count($employees); ++$i)
+        $employees_count = count($employees);
+		for ($i = 0; $i < $employees_count; ++$i)
 		{
 			/* remove numeric fields */
@@ -396,5 +401,6 @@
 		$cachedLDAP = Factory::newInstance('CachedLDAP');
 		$cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_NORMAL);
-		for ($i = 0; $i < count($employees); ++$i)
+        $employees_count = count($employees);
+		for ($i = 0; $i < $employees_count; ++$i)
 		{
 			/* remove numeric fields */
@@ -434,5 +440,6 @@
 
 		if (count($searchTermExploded) > 0){
-			for ($i=1; $i<count($searchTermExploded); ++$i) {
+            $searchTermExploded_count = count($searchTermExploded);
+			for ($i=1; $i<$searchTermExploded_count; ++$i) {
 				if (strlen($searchTermExploded[$i]) > 2) {
 					$fullSearch = true;
@@ -481,5 +488,6 @@
 
 		/* filling return array with employee's information */
-		for ($i = 0; $i < count($result); ++$i) {
+        $result_count = count($result);
+		for ($i = 0; $i < $result_count; ++$i) {
 			$employees []= array(
 					'area'	 			=> $result[$i]['area'],
@@ -536,5 +544,6 @@
 		/* creating the ldap query */
 		$ldap_query = '(&(|';
-		for ($i = 0; $i < count($result); ++$i) {
+        $result_count = count($result);
+		for ($i = 0; $i < $result_count; ++$i) {
 			$ldap_query .= '(uidNumber=' . $result[$i]['funcionario_id'] . ')';
 		}
@@ -556,5 +565,6 @@
 		/* filling return array with employee's information */
 		$employees = array();
-		for ($i = 0; $i < count($result); ++$i) {
+        $result_count = count($result);
+		for ($i = 0; $i < $result_count; ++$i) {
 
 			$employee = array();
@@ -642,5 +652,6 @@
 
 		/* filling return array with employee's information */
-		for ($i = 0; $i < count($result); ++$i) {
+        $result_count = count($result);
+		for ($i = 0; $i < $result_count; ++$i) {
 			$employees []= array(
 					'area'	 			=> $result[$i]['area'],
@@ -707,5 +718,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
 				unset($output[$i][$j]);
@@ -728,5 +740,6 @@
 
 		$output = $result->GetArray(-1);
-		for ( $i = 0; $i < count($output); ++$i )
+        $output_count = count($output);
+		for ( $i = 0; $i < $output_count; ++$i )
 		{
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
@@ -759,5 +772,6 @@
 
 		$output = $result->GetArray( -1 );
-		for ( $i = 0; $i < count($output); ++$i )
+        $output_count = count($output);
+		for ( $i = 0; $i < $output_count; ++$i )
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
 				unset($output[$i][$j]);
@@ -795,5 +809,6 @@
 
 		$categoriesCount = array( );
-		for ( $i = 0; $i < count( $employees ); ++$i )
+        $employees_count = count( $employees );
+		for ( $i = 0; $i < $employees_count; ++$i )
 		{
 			// remove numeric fields
@@ -867,5 +882,6 @@
 
 		$categoriesCount = array( );
-		for ( $i = 0; $i < count( $employees ); ++$i )
+        $employees_count = count( $employees );
+		for ( $i = 0; $i < $employees_count; ++$i )
 		{
 			// remove numeric fields
@@ -893,5 +909,6 @@
 
 		// count the number of employees in each category
-		for ( $i = 0; $i < count( $employees ); ++$i )
+        $employees_count = count( $employees );
+		for ( $i = 0; $i < $employees_count; ++$i )
 		{
 			$categoryID = $employees[ $i ][ 'funcionario_categoria_id' ];
Index: /trunk/workflow/inc/class.bo_userinterface.inc.php
===================================================================
--- /trunk/workflow/inc/class.bo_userinterface.inc.php	(revision 7655)
+++ /trunk/workflow/inc/class.bo_userinterface.inc.php	(revision 7673)
@@ -846,5 +846,6 @@
 
 		$areas = $this->so->getAreaList($this->organizationInfo['organizacao_id']);
-		for ($i = 0; $i < count($areas); ++$i)
+        $areas_count = count($areas);
+		for ($i = 0; $i < $areas_count; ++$i)
 		{
 			$areas[$i]['children'] = false;
Index: /trunk/workflow/inc/class.so_external_applications.inc.php
===================================================================
--- /trunk/workflow/inc/class.so_external_applications.inc.php	(revision 7655)
+++ /trunk/workflow/inc/class.so_external_applications.inc.php	(revision 7673)
@@ -148,5 +148,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
 				unset($output[$i][$j]);
@@ -170,5 +171,6 @@
 
 		$output = $result->GetArray(-1);
-		for ($i = 0; $i < count($output); ++$i)
+        $output_count = count($output);
+		for ($i = 0; $i < $output_count; ++$i)
 			for ($j = 0; $j < $result->_numOfFields; ++$j)
 				unset($output[$i][$j]);
Index: /trunk/workflow/inc/class.Paging.inc.php
===================================================================
--- /trunk/workflow/inc/class.Paging.inc.php	(revision 7655)
+++ /trunk/workflow/inc/class.Paging.inc.php	(revision 7673)
@@ -224,6 +224,6 @@
 			$links[] = $tmp;
 		}
-
-		for ($i = 0; $i < count($paginationLinks); ++$i)
+        $paginationLinks_count = count($paginationLinks);
+		for ($i = 0; $i < $paginationLinks_count; ++$i)
 		{
 			$tmp = $paginationLinks[$i];
Index: /trunk/workflow/inc/class.ui_orgchart.inc.php
===================================================================
--- /trunk/workflow/inc/class.ui_orgchart.inc.php	(revision 7655)
+++ /trunk/workflow/inc/class.ui_orgchart.inc.php	(revision 7673)
@@ -152,5 +152,6 @@
 
 			$ldap = &Factory::getInstance('WorkflowLDAP');
-			for ($i = 0; $i < count($output); ++$i)
+            $output_count = count($output);
+			for ($i = 0; $i < $output_count; ++$i)
 			{
 				for ($j = 0; $j < $result->_numOfFields; ++$j)
@@ -162,5 +163,6 @@
 					$supervisorArray = explode(' ', $supervisor);
 					$supervisorName = '';
-					for ($j = 0; $j < count($supervisorArray); ++$j)
+                    $supervisorArray_count = count($supervisorArray);
+					for ($j = 0; $j < $supervisorArray_count; ++$j)
 						$supervisorName .= (($j == 0) || ($j == count($supervisorArray) - 1)) ? $supervisorArray[$j] . ' ' : $supervisorArray[$j][0] . '. ';
 					$supervisorName = trim(str_replace("Junior", "Jr", $supervisorName));
Index: /trunk/expressoMail1_2/login_offline.php
===================================================================
--- /trunk/expressoMail1_2/login_offline.php	(revision 7655)
+++ /trunk/expressoMail1_2/login_offline.php	(revision 7673)
@@ -195,6 +195,7 @@
 		$obj_organization = CreateObject('phpgwapi.sector_search_ldap');
 		$organizations = $obj_organization->organization_search($GLOBALS['phpgw_info']['server']['ldap_context']);
-		
-		for ($i=0; $i<count($organizations); ++$i)
+
+        $organizations_count = count($organizations);
+		for ($i=0; $i<$organizations_count; ++$i)
 		{
 			$tmp_array[strtolower($organizations[$i])] = $organizations[$i];	
Index: /trunk/expressoMail1_2/inc/class.db_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.db_functions.inc.php	(revision 7655)
+++ /trunk/expressoMail1_2/inc/class.db_functions.inc.php	(revision 7673)
@@ -181,7 +181,8 @@
 
 	function getAddrs($array_addrs) {
-		$array_addrs_final = array();				
-
-		for($i = 0; $i < count($array_addrs); ++$i){
+		$array_addrs_final = array();
+
+        $array_addrs_count = count($array_addrs);
+		for($i = 0; $i < $array_addrs_count; ++$i){
 			$j = count($array_addrs_final);
 
Index: /trunk/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 7655)
+++ /trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 7673)
@@ -245,5 +245,6 @@
 								array('filter' => $filter, 'criteria' => array('deepness' => '2'))
 							);
-							for($i=0; $i<count($sort_array_msg); ++$i){
+                            $sort_array_msg_count = count($sort_array_msg);
+							for($i=0; $i<$sort_array_msg_count; ++$i){
 								if(!isset($return[$i]['msg_number']))
 									continue;
@@ -518,5 +519,6 @@
 			$elements = imap_mime_header_decode($string);
 
-  			for($i = 0;$i < count($elements);++$i)
+            $elements_count = count($elements);
+  			for($i = 0;$i < $elements_count;++$i)
   			{
    				$charset = strtolower($elements[$i]->charset);
@@ -785,6 +787,7 @@
 			$return = array();
 			$array_names_keys = array_keys($sorted_msgs);
-			
-			for($i = 0; $i < count($sorted_msgs); ++$i){
+
+            $sorted_msgs_count = count($sorted_msgs);
+			for($i = 0; $i < $sorted_msgs_count; ++$i){
 			
 				$new_params = array();
@@ -2559,5 +2562,6 @@
 		}else{
 			$child = $base_path.$this->imap_delimiter;
-			for($i =0; $i < count($test); ++$i){
+            $test_count = count($test);
+			for($i =0; $i < $test_count; ++$i){
 				$child .= ($test[$i] ? $test[$i] : $this->functions->getLang("New Folder"));
 				$namebox =  mb_convert_encoding($child, "UTF7-IMAP", "UTF-8");
@@ -3654,5 +3658,6 @@
 			return $returns;
 		}else{
-			for($i = 0; $i < count($array_names_keys); ++$i){
+            $array_names_keys_count = count($array_names_keys);
+			for($i = 0; $i < $array_names_keys_count; ++$i){
 				$param['folder'] = $array_names_keys[$i];
 				$param['msgs_to_set'] = $sorted_msgs[$array_names_keys[$i]];
Index: /trunk/expressoMail1_2/inc/class.exporteml.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.exporteml.inc.php	(revision 7655)
+++ /trunk/expressoMail1_2/inc/class.exporteml.inc.php	(revision 7673)
@@ -123,5 +123,6 @@
                     if (is_array($files))
                     {
-                        for ($i=0; $i < count($files); ++$i)
+                        $files_count = count($files);
+                        for ($i=0; $i < $files_count; ++$i)
                         {
                             $files[$i] = escapeshellarg($files[$i]);
@@ -315,5 +316,6 @@
 			
 			//cria um .zip com as mensagens selecionadas
-			for($i = 0; $i < count($msg_number); ++$i)
+            $msg_number_count = count($msg_number);
+			for($i = 0; $i < $msg_number_count; ++$i)
 			{
 				$header         = $this-> getHeader($msg_number[$i]);                                                                                   
@@ -353,12 +355,14 @@
 		}else{
 			$array_names_keys = array_keys($sorted_msgs);
-			
-			for($i = 0; $i < count($array_names_keys); ++$i){
+
+            $array_names_keys_count = count($array_names_keys);
+			for($i = 0; $i < $array_names_keys_count; ++$i){
 				$this->folder = mb_convert_encoding($array_names_keys[$i], "UTF7-IMAP","UTF-8, ISO-8859-1, UTF7-IMAP");
 				$msg_number = explode(',', $sorted_msgs[$array_names_keys[$i]]);
 				$tempDir = $this->tempDir;
 				$this->connectImap();
-				
-				for($j = 0; $j < count($msg_number); ++$j)
+
+                $msg_number_count = count($msg_number);
+				for($j = 0; $j < $msg_number_count; ++$j)
 				{
 					$header         = $this-> getHeader($msg_number[$j]);                                                                                   
@@ -474,5 +478,6 @@
 			}
 
-			for($i = 0; $i < count($array_ids); ++$i)
+            $array_ids_count = count($array_ids);
+			for($i = 0; $i < $array_ids_count; ++$i)
 			{
 				$header         = $this-> getHeader($array_ids[$i]);                                                                                   
@@ -796,6 +801,6 @@
 		
 		$fileNames = Array();
-			
-		for ($i = 0; $i < count($attachments); ++$i)
+		$attachments_count = count($attachments);
+		for ($i = 0; $i < $attachments_count; ++$i)
                 {
                    $attachments[$i]['name'] = $this->remove_accents($attachments[$i]['name']);
@@ -803,5 +808,6 @@
                 }
 
-                for ($i = 0; $i < count($attachments); ++$i)
+                $attachments_count = count($attachments);
+                for ($i = 0; $i < $attachments_count; ++$i)
                 {
                         $fileName = $attachments[$i]['name'];
@@ -811,5 +817,6 @@
                         if (count($result) > 1)
                         {
-                            for ($j = 1; $j < count($result); ++$j)
+                            $result_count = count($result);
+                            for ($j = 1; $j < $result_count; ++$j)
                             {
                                 $replacement = '('.$j.')$0';
Index: /trunk/expressoMail1_2/inc/class.message_components.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.message_components.inc.php	(revision 7655)
+++ /trunk/expressoMail1_2/inc/class.message_components.inc.php	(revision 7673)
@@ -107,5 +107,6 @@
                 }
 
-                for($p = 0, $i = 1; $p < count($parts); ++$n, ++$p, ++$i)
+                $parts_count = count($parts);
+                for($p = 0, $i = 1; $p < $parts_count; ++$n, ++$p, ++$i)
                 {
                     // Skip the following...
Index: /trunk/expressoMail1_2/inc/class.functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.functions.inc.php	(revision 7655)
+++ /trunk/expressoMail1_2/inc/class.functions.inc.php	(revision 7673)
@@ -126,6 +126,7 @@
 				$includeFiles[0] = null;
 				// End Bug fixed.
-			}														
-			for($i = 0; $i < count($files); ++$i) {
+			}
+            $files_count = count($files);
+			for($i = 0; $i < $files_count; ++$i) {
 				if(count(explode('.js',$files[$i])) > 1) {
 					if($includeFiles  && array_search(trim($files[$i]),$includeFiles)){	
Index: /trunk/expressoMail1_2/inc/class.phpmailer.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.phpmailer.php	(revision 7655)
+++ /trunk/expressoMail1_2/inc/class.phpmailer.php	(revision 7673)
@@ -472,5 +472,6 @@
     function MailSend($header, $body) {
         $to = "";
-        for($i = 0; $i < count($this->to); ++$i)
+        $to_count = count($this->to);
+        for($i = 0; $i < $to_count; ++$i)
         {
             if($i != 0) { $to .= ", "; }
@@ -533,15 +534,18 @@
 
         // Attempt to send attach all recipients
-        for($i = 0; $i < count($this->to); ++$i)
+        $to_count = count($this->to);
+        for($i = 0; $i < $to_count; ++$i)
         {
 		if(!$this->smtp->Recipient($this->to[$i][0]))
 			$bad_rcpt[] = $this->to[$i][0];
         }
-        for($i = 0; $i < count($this->cc); ++$i)
+        $cc_count = count($this->cc);
+        for($i = 0; $i < $cc_count; ++$i)
         {
 		if(!$this->smtp->Recipient($this->cc[$i][0]))
 			$bad_rcpt[] = $this->cc[$i][0];
         }
-        for($i = 0; $i < count($this->bcc); ++$i)
+        $bcc_count = count($this->bcc);
+        for($i = 0; $i < $bcc_count; ++$i)
         {
                 if(!$this->smtp->Recipient($this->bcc[$i][0]))
@@ -563,6 +567,7 @@
             //Postfix version 2.1.5-9
             $array_error = explode(":", $this->smtp->error['smtp_msg']);
-            
-            for($i = 0; $i < count($bad_rcpt); ++$i)
+
+            $bad_rcpt_count = count($bad_rcpt);
+            for($i = 0; $i < $bad_rcpt_count; ++$i)
             {
                 if($i != 0) { $error .= ", "; }
@@ -826,5 +831,6 @@
         if(count($addr) > 1)
         {
-            for($i = 1; $i < count($addr); ++$i)
+            $addr_count = count($addr);
+            for($i = 1; $i < $addr_count; ++$i)
                 $addr_str .= ", " . $this->AddrFormat($addr[$i]);
         }
@@ -867,9 +873,11 @@
         $line = explode($this->LE, $message);
         $message = "";
-        for ($i=0 ;$i < count($line); ++$i)
+        $line_count = count($line);
+        for ($i=0 ;$i < $line_count; ++$i)
         {
           $line_part = explode(" ", $line[$i]);
           $buf = "";
-          for ($e = 0; $e<count($line_part); $e++)
+          $line_part_count = count($line_part);
+          for ($e = 0; $e<$line_part_count; $e++)
           {
               $word = $line_part[$e];
@@ -1031,5 +1039,6 @@
 
         // Add custom headers
-        for($index = 0; $index < count($this->CustomHeader); ++$index)
+        $CustomHeader_count = count($this->CustomHeader);
+        for($index = 0; $index < $CustomHeader_count; ++$index)
         {
             $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), 
@@ -1265,5 +1274,6 @@
 
         // Add all attachments
-        for($i = 0; $i < count($this->attachment); ++$i)
+        $attachment_count = count($this->attachment);
+        for($i = 0; $i < $attachment_count; ++$i)
         {
             // Check for string attachment
@@ -1540,5 +1550,6 @@
     function InlineImageExists() {
         $result = false;
-        for($i = 0; $i < count($this->attachment); ++$i)
+        $attachment_count = count($this->attachment);
+        for($i = 0; $i < $attachment_count; ++$i)
         {
             if($this->attachment[$i][6] == "inline")
Index: /trunk/home.php
===================================================================
--- /trunk/home.php	(revision 7655)
+++ /trunk/home.php	(revision 7673)
@@ -108,6 +108,7 @@
         $sorted_apps = array();
         $user_apps = $GLOBALS['phpgw_info']['user']['apps']; 
-        @reset($user_apps);     
-        for($i = 0; $i < count($default_apps);++$i) {
+        @reset($user_apps);
+        $default_apps_count = count($default_apps);
+        for($i = 0; $i < $default_apps_count;++$i) {
                 if(array_key_exists($default_apps[$i], $user_apps)){
                         $sorted_apps[] = $default_apps[$i];
