Convert foreach to while loop

This commit is contained in:
Miles Lott 2001-08-07 23:18:21 +00:00
parent 5efdffad7b
commit b51bb7b055

View File

@ -256,7 +256,8 @@
if (is_array($b)) if (is_array($b))
{ {
foreach ($b as $id => $cont) @reset($b);
while(list($id,$cont) = @each($b))
{ {
$b[$id] = $cont->scalarval(); $b[$id] = $cont->scalarval();
} }
@ -266,11 +267,13 @@
if (is_object($b)) if (is_object($b))
{ {
$t = get_object_vars($b); $t = get_object_vars($b);
foreach ($t as $id => $cont) @reset($t);
while(list($id,$cont) = @each($t))
{ {
$t[$id] = $cont->scalarval(); $t[$id] = $cont->scalarval();
} }
foreach ($t as $id => $cont) @reset($t);
while(list($id,$cont) = @each($t))
{ {
eval('$b->'.$id.' = $cont;'); eval('$b->'.$id.' = $cont;');
} }