Example #1
0
 /**
 		Returns true if the two arrays are the same, which means they have the same
 		number of objects and each object at each index is strictly the same type
 		and value.
 		\param $anArray
 		\returns BOOL
 */
 public function isEqualToArray(RTArray $anArray)
 {
     if ($this->count() == $anArray->count()) {
         for ($i = 0; $i < $this->count(); $i++) {
             $left = $this->objectAtIndex($i);
             $right = $anArray->objectAtIndex($i);
             if (is_object($left) && is_object($right)) {
                 if ($left->description() !== $right->description()) {
                     return NO;
                 }
             } else {
                 if ($left !== $right) {
                     return NO;
                 }
             }
         }
         return YES;
     }
     return NO;
 }