diff options
| -rw-r--r-- | adodb-datadict.inc.php | 2 | ||||
| -rw-r--r-- | adodb-error.inc.php | 2 | ||||
| -rw-r--r-- | adodb.inc.php | 3 | ||||
| -rw-r--r-- | drivers/adodb-ado.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-ado5.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-text.inc.php | 6 | ||||
| -rw-r--r-- | replicate/adodb-replicate.inc.php | 3 | ||||
| -rw-r--r-- | toexport.inc.php | 2 |
8 files changed, 10 insertions, 12 deletions
diff --git a/adodb-datadict.inc.php b/adodb-datadict.inc.php index adeecdd0..1c80135e 100644 --- a/adodb-datadict.inc.php +++ b/adodb-datadict.inc.php @@ -520,7 +520,7 @@ class ADODB_DataDict { list($lines,$pkey,$idxs) = $this->_GenFields($flds); // genfields can return FALSE at times if ($lines == null) $lines = array(); - list(,$first) = each($lines); + $first = current($lines); list(,$column_def) = preg_split("/[\t ]+/",$first,2); } return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def)); diff --git a/adodb-error.inc.php b/adodb-error.inc.php index 46ae03e2..020f65d0 100644 --- a/adodb-error.inc.php +++ b/adodb-error.inc.php @@ -115,7 +115,7 @@ function adodb_error_pg($errormsg) 'could not serialize access due to' => DB_ERROR_SERIALIZATION_FAILURE ); reset($error_regexps); - while (list($regexp,$code) = each($error_regexps)) { + foreach ($error_regexps as $regexp => $code) { if (preg_match("/$regexp/mi", $errormsg)) { return $code; } diff --git a/adodb.inc.php b/adodb.inc.php index 6c567f3c..2757072d 100644 --- a/adodb.inc.php +++ b/adodb.inc.php @@ -1190,8 +1190,7 @@ if (!defined('_ADODB_LAYER')) { foreach($inputarr as $arr) { $sql = ''; $i = 0; - //Use each() instead of foreach to reduce memory usage -mikefedyk - while(list(, $v) = each($arr)) { + foreach ($arr as $v) { $sql .= $sqlarr[$i]; // from Ron Baldwin <ron.baldwin#sourceprose.com> // Only quote string types diff --git a/drivers/adodb-ado.inc.php b/drivers/adodb-ado.inc.php index 69110b85..a87aedce 100644 --- a/drivers/adodb-ado.inc.php +++ b/drivers/adodb-ado.inc.php @@ -225,7 +225,7 @@ class ADODB_ado extends ADOConnection { // Map by http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthcreateparam.asp // Check issue http://bugs.php.net/bug.php?id=40664 !!! - while(list(, $val) = each($inputarr)) { + foreach ($inputarr as $val) { $type = gettype($val); $len=strlen($val); if ($type == 'boolean') diff --git a/drivers/adodb-ado5.inc.php b/drivers/adodb-ado5.inc.php index 36f590d4..08871b2e 100644 --- a/drivers/adodb-ado5.inc.php +++ b/drivers/adodb-ado5.inc.php @@ -248,7 +248,7 @@ class ADODB_ado extends ADOConnection { $oCmd->CommandText = $sql; $oCmd->CommandType = 1; - while(list(, $val) = each($inputarr)) { + foreach ($inputarr as $val) { $type = gettype($val); $len=strlen($val); if ($type == 'boolean') diff --git a/drivers/adodb-text.inc.php b/drivers/adodb-text.inc.php index d2900b6e..b9a588d4 100644 --- a/drivers/adodb-text.inc.php +++ b/drivers/adodb-text.inc.php @@ -205,7 +205,7 @@ class ADODB_text extends ADOConnection { $where_arr = array(); reset($this->_origarray); - while (list($k_arr,$arr) = each($this->_origarray)) { + foreach ($this->_origarray as $arr) { if ($i == 0 && $this->_skiprow1) $where_arr[] = $arr; @@ -243,7 +243,7 @@ class ADODB_text extends ADOConnection { $i = 0; $n = ''; reset($this->_colnames); - while (list($k_n,$n) = each($this->_colnames)) { + foreach ($this->_colnames as $n) { if ($col == strtoupper(trim($n))) break; $i += 1; @@ -298,7 +298,7 @@ class ADODB_text extends ADOConnection { if ($at == 0) { $i = 0; reset($projnames); - while (list($k_n,$n) = each($projnames)) { + foreach ($projnames as $n) { if (strtoupper(trim($n)) == $col) { $at = $i+1; break; diff --git a/replicate/adodb-replicate.inc.php b/replicate/adodb-replicate.inc.php index 9aaf3c42..f13e4af7 100644 --- a/replicate/adodb-replicate.inc.php +++ b/replicate/adodb-replicate.inc.php @@ -794,8 +794,7 @@ word-wrap: break-word; /* Internet Explorer 5.5+ */ if ($useQmark) { $sql = ''; $i = 0; $arr = array_reverse($rs->fields); - //Use each() instead of foreach to reduce memory usage -mikefedyk - while(list(, $v) = each($arr)) { + foreach ($arr as $v) { $sql .= $sqlarr[$i]; // from Ron Baldwin <ron.baldwin#sourceprose.com> // Only quote string types diff --git a/toexport.inc.php b/toexport.inc.php index 97b171cf..70f4e6dc 100644 --- a/toexport.inc.php +++ b/toexport.inc.php @@ -77,7 +77,7 @@ function _adodb_export(&$rs,$sep,$sepreplace,$fp=false,$addtitles=true,$quote = reset($fieldTypes); $i = 0; $elements = array(); - while(list(,$o) = each($fieldTypes)) { + foreach ($fieldTypes as $o) { $v = ($o) ? $o->name : 'Field'.($i++); if ($escquote) $v = str_replace($quote,$escquotequote,$v); |
