summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-03-30 23:58:47 (GMT)
committerIlia Alshanetsky <iliaa@php.net>2004-03-30 23:58:47 (GMT)
commit8ecdc90763aa5da2ff70531b63fdd7add40cc3d6 (patch)
treea53851c9923d4bdd85c8d6e6994d20d3daa25b10 /run-tests.php
parent9f8ba2e8a13966eb4b7832d8909ce4ddaa76af2f (diff)
downloadphp-8ecdc90763aa5da2ff70531b63fdd7add40cc3d6.tar.gz
Fixed generate_array_diff().
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/run-tests.php b/run-tests.php
index 026a543..dbd74eb 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -1039,23 +1039,19 @@ function generate_array_diff($ar1,$ar2,$is_reg,$w)
if ($k1 == $l1+1 || $k2 === NULL) {
$l1 = $k1;
$diff[] = current($old1);
- next($old1);
- $k1 = key($old1);
+ $k1 = next($old1) ? key($old1) : NULL;
} else if ($k2 == $l2+1 || $k1 === NULL) {
$l2 = $k2;
$diff[] = current($old2);
- next($old2);
- $k2 = key($old2);
+ $k2 = next($old2) ? key($old2) : NULL;
} else if ($k1 < $k2) {
$l1 = $k1;
$diff[] = current($old1);
- next($old1);
- $k1 = key($old1);
+ $k1 = next($old1) ? key($old1) : NULL;
} else {
$l2 = $k2;
$diff[] = current($old2);
- next($old2);
- $k2 = key($old2);
+ $k2 = next($old2) ? key($old2) : NULL;
}
}
while ($idx1 < $cnt1) {