diff --git a/lib/Doctrine/Common/Collections/Collection.php b/lib/Doctrine/Common/Collections/Collection.php index b9c4d0eb8..4ee8dc25b 100644 --- a/lib/Doctrine/Common/Collections/Collection.php +++ b/lib/Doctrine/Common/Collections/Collection.php @@ -120,10 +120,11 @@ class Collection implements Countable, IteratorAggregate, ArrayAccess { $key = array_search($element, $this->_elements, true); if ($key !== false) { + $removed = $this->_elements[$key]; unset($this->_elements[$key]); - return true; + return $removed; } - return false; + return null; } /**