diff --git a/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php b/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php
+++ b/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php
@@ -289,8 +289,9 @@ class ManyToManyPersister extends AbstractCollectionPersister
             }
         }
 
-        $sql = implode(' AND ', $filterClauses);
-        return $sql ? '(' . $sql . ')' : '';
+        return $filterClauses
+            ? '(' . implode(' AND ', $filterClauses) . ')'
+            : '';
     }
 
     /**
#<I> DDC-<I> - removed unused assignment, direct return instead