diff --git a/Gettext/Entries.php b/Gettext/Entries.php index cefe0dd9..2be86f3e 100644 --- a/Gettext/Entries.php +++ b/Gettext/Entries.php @@ -200,9 +200,11 @@ public function mergeWith(Entries $entries, $method = null) } if ($method & self::MERGE_REMOVE) { - foreach ($this as $k => $entry) { + $iterator = $this->getIterator(); + + foreach ($iterator as $k => $entry) { if (!($existing = $entries->find($entry))) { - unset($this[$k]); + $iterator->offsetUnset($k); } } }