diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 803e6683c32..eb3111fb8d1 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1735,7 +1735,7 @@ private function doMerge($entity, array &$visited, $prevManagedCopy = null, $ass $managedCol->initialize(); // clear and set dirty a managed collection if its not also the same collection to merge from. - if (!$managedCol->isEmpty() && $managedCol != $mergeCol) { + if (!$managedCol->isEmpty() && $managedCol !== $mergeCol) { $managedCol->unwrap()->clear(); $managedCol->setDirty(true);