Fixed PHP3 compatibility (foreach-loops).

This commit is contained in:
Garvin Hicking
2003-02-03 17:56:05 +00:00
parent ad3180bd46
commit bdf38ed3da
2 changed files with 10 additions and 6 deletions

View File

@@ -37,7 +37,8 @@ if (!defined('PMA_DBG_PROFILING_INCLUDED')) {
'<td>' . $GLOBALS['strDBGContext'] . '</td>' . "\n" .
'</tr></thead>' . "\n" .
'<tbody style="vertical-align: top">' . "\n";
foreach ($dbg_prof_results['line_no'] as $idx => $line_no) {
@reset($dbg_prof_results['line_no']);
while(list($idx, $line_no) = each($dbg_prof_results['line_no'])) {
$mod_no = $dbg_prof_results['mod_no'][$idx];
dbg_get_module_name($mod_no, &$mod_name);

View File

@@ -216,7 +216,8 @@ class XPath {
$aExistingAttributes = $this->getAttributes($absoluteXPath);
$aExistingAttributes = array_intersect($aExistingAttributes, $attributes);
$aNewAttributes = $attributes;
foreach($aExistingAttributes as $name => $value)
@reset($aExistingAttributes);
while(list($name, $value) = each($aExistingAttributes)) {
unset($aNewAttributes[$name]);
return $this->setAttributes($absoluteXPath, $aNewAttributes);
} else {
@@ -982,7 +983,8 @@ class XPath {
}
// Remove all the elements in the array then.
foreach($attribute as $name) {
@reset($attribute);
while(list(, $name) = each($attribute)) {
unset($this->nodes[$absoluteXPath]['attributes'][$name]);
}
return;
@@ -1052,8 +1054,8 @@ class XPath {
}
}
// Return the cdata of the node.
foreach($this->nodes[$absoluteXPath]["text"] as $textNode)
{
@reset($this->nodes[$absoluteXPath]['text']);
while(list(, $textNode) = each($this->nodes[$absoluteXPath]['text'])) {
$text[] = $textNode;
}
return $text;
@@ -3446,7 +3448,8 @@ class XPath {
if ( $axis["node-test"] == "cdata" ) {
if ( !isSet($this->nodes[$context]["text"]) ) return "";
foreach ($this->nodes[$context]['text'] as $index => $text) {
@reset($this->nodes[$context]['text']);
while(list($index, $text) = each($this->nodes[$context]['text'])) {
$nodes[] = $context . "/text()[".($index + 1)."]";
}
}