Skip to content
Browse files

Fix #72.

  • Loading branch information...
1 parent 8dc2ecd commit de9052e8a7d6fd5a0b4e0d6e5a4571861d2d0163 @sebastianbergmann committed
Showing with 13 additions and 9 deletions.
  1. +13 −9 PHPUnit/Framework/Constraint/IsEqual.php
View
22 PHPUnit/Framework/Constraint/IsEqual.php
@@ -176,15 +176,8 @@ protected function recursiveComparison($a, $b, $depth = 0)
return TRUE;
}
- // Normal comparision for scalar values.
- if ((!is_array($a) && !is_object($a)) ||
- (!is_array($b) && !is_object($b))) {
- if (is_numeric($a) && is_numeric($b)) {
- // Optionally apply delta on numeric values.
- return $this->numericComparison($a, $b);
- } else {
- return ($a == $b);
- }
+ if (is_array($a) XOR is_array($b)) {
+ return FALSE;
}
if (is_object($a) XOR is_object($b)) {
@@ -196,6 +189,17 @@ protected function recursiveComparison($a, $b, $depth = 0)
return FALSE;
}
+ // Normal comparision for scalar values.
+ if ((!is_array($a) && !is_object($a)) ||
+ (!is_array($b) && !is_object($b))) {
+ if (is_numeric($a) && is_numeric($b)) {
+ // Optionally apply delta on numeric values.
+ return $this->numericComparison($a, $b);
+ } else {
+ return ($a == $b);
+ }
+ }
+
if (is_object($a)) {
$a = (array) $a;
$b = (array) $b;

0 comments on commit de9052e

Please sign in to comment.
Something went wrong with that request. Please try again.