diff --git a/html/includes/collectd/functions.php b/html/includes/collectd/functions.php
index 8b6d9f5c4c..d7b44a969e 100644
--- a/html/includes/collectd/functions.php
+++ b/html/includes/collectd/functions.php
@@ -560,7 +560,8 @@ function collectd_draw_rrd($host, $plugin, $pinst = null, $type, $tinst = null,
$rrd_cmd = array_merge($rrd_cmd, $config['rrd_opts_array'], $opts['rrd_opts'], $graph);
$cmd = RRDTOOL;
- for ($i = 1; $i < count($rrd_cmd); $i++)
+ $count_rrd_cmd = count($rrd_cmd);
+ for ($i = 1; $i < $count_rrd_cmd; $i++)
$cmd .= ' '.escapeshellarg($rrd_cmd[$i]);
return $cmd;
@@ -611,7 +612,8 @@ function collectd_draw_generic($timespan, $host, $plugin, $pinst = null, $type,
$rrdgraph = array_merge($rrd_cmd, $rrd_args);
$cmd = RRDTOOL;
- for ($i = 1; $i < count($rrdgraph); $i++)
+ $count_rrdgraph = count($rrdgraph);
+ for ($i = 1; $i < $count_rrdgraph; $i++)
$cmd .= ' '.escapeshellarg($rrdgraph[$i]);
return $cmd;
@@ -712,7 +714,8 @@ function collectd_draw_meta_stack(&$opts, &$sources) {
}
$rrdcmd = RRDTOOL;
- for ($i = 1; $i < count($cmd); $i++)
+ $count_cmd = count($cmd);
+ for ($i = 1; $i < $count_cmd; $i++)
$rrdcmd .= ' '.escapeshellarg($cmd[$i]);
return $rrdcmd;
}
@@ -793,7 +796,8 @@ function collectd_draw_meta_line(&$opts, &$sources) {
}
$rrdcmd = RRDTOOL;
- for ($i = 1; $i < count($cmd); $i++)
+ $count_cmd = count($cmd);
+ for ($i = 1; $i < $count_cmd; $i++)
$rrdcmd .= ' '.escapeshellarg($cmd[$i]);
return $rrdcmd;
}
diff --git a/includes/console_table.php b/includes/console_table.php
index c07767ff0e..0f325d4f27 100755
--- a/includes/console_table.php
+++ b/includes/console_table.php
@@ -489,7 +489,8 @@ class Console_Table
$this->_splitMultilineRows();
// Update cell lengths.
- for ($i = 0; $i < count($this->_headers); $i++) {
+ $count_headers = count($this->_headers);
+ for ($i = 0; $i < $count_headers; $i++) {
$this->_calculateCellLengths($this->_headers[$i]);
}
for ($i = 0; $i < $this->_max_rows; $i++) {
@@ -570,8 +571,10 @@ class Console_Table
$separator = $this->_getSeparator();
$return = array();
- for ($i = 0; $i < count($this->_data); $i++) {
- for ($j = 0; $j < count($this->_data[$i]); $j++) {
+ $count_data = count($this->_data);
+ for ($i = 0; $i < $count_data; $i++) {
+ $count_data_i = count($this->_data[$i]);
+ for ($j = 0; $j < $count_data_i; $j++) {
if ($this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE &&
$this->_strlen($this->_data[$i][$j]) <
$this->_cell_lengths[$j]) {
@@ -648,7 +651,8 @@ class Console_Table
function _getHeaderLine()
{
// Make sure column count is correct
- for ($j = 0; $j < count($this->_headers); $j++) {
+ $count_headers = count($this->_headers);
+ for ($j = 0; $j < $count_headers; $j++) {
for ($i = 0; $i < $this->_max_cols; $i++) {
if (!isset($this->_headers[$j][$i])) {
$this->_headers[$j][$i] = '';
@@ -656,8 +660,10 @@ class Console_Table
}
}
- for ($j = 0; $j < count($this->_headers); $j++) {
- for ($i = 0; $i < count($this->_headers[$j]); $i++) {
+ $count_headers = count($this->_headers);
+ for ($j = 0; $j < $count_headers; $j++) {
+ $count_headers_j = count($this->_headers[$j]);
+ for ($i = 0; $i < $count_headers_j; $i++) {
if ($this->_strlen($this->_headers[$j][$i]) <
$this->_cell_lengths[$i]) {
$this->_headers[$j][$i] =
@@ -733,7 +739,8 @@ class Console_Table
*/
function _calculateCellLengths($row)
{
- for ($i = 0; $i < count($row); $i++) {
+ $count_row = count($row);
+ for ($i = 0; $i < $count_row; $i++) {
if (!isset($this->_cell_lengths[$i])) {
$this->_cell_lengths[$i] = 0;
}
diff --git a/includes/dbFacile.php b/includes/dbFacile.php
index 1f98bc1c97..1f18c1a6fd 100644
--- a/includes/dbFacile.php
+++ b/includes/dbFacile.php
@@ -313,7 +313,8 @@ function dbMakeQuery($sql, $parameters) {
// every-other item in $result will be the placeholder that was found
$query = '';
- for($i = 0; $i < sizeof($result); $i+=2) {
+ $res_size = sizeof($result);
+ for($i = 0; $i < $res_size; $i+=2) {
$query .= $result[ $i ];
$j = $i+1;