/** * Compares the specified object with this list for equality. * @param multitype $object * @return boolean */ public function equals($object) { if ($object instanceof ListInterface && $object->size() === $this->size()) { foreach ($object->toArray() as $index => $element) { if ($element !== $this->array[$index]) { return false; } } return true; } return false; }