DDC-3219: Ensure PersistentCollection->count() is of type int #3984

Open
opened 2026-01-22 14:32:57 +01:00 by admin · 1 comment
Owner

Originally created by @doctrinebot on GitHub (Jul 21, 2014).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user flip101:

https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/PersistentCollection.php#L566-L577 does not always return an int. How do i know this? because i compare this count with a php count() with strict checking.

If ($collection->count() !== count($somethingElse)) {
throw new Exception($collection->count() . ' is different then ' . count($somethingElse));
}

and at one time this message showed: 3 is different then 3

Originally created by @doctrinebot on GitHub (Jul 21, 2014). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user flip101: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/PersistentCollection.php#L566-L577 does not always return an int. How do i know this? because i compare this count with a php count() with strict checking. If ($collection->count() !== count($somethingElse)) { throw new Exception($collection->count() . ' is different then ' . count($somethingElse)); } and at one time this message showed: 3 is different then 3
admin added the Bug label 2026-01-22 14:32:57 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jul 21, 2014):

Comment created by flip101:

My colleague told me that it was his mistake somehow, so i don't know how valid this really is !!!

@doctrinebot commented on GitHub (Jul 21, 2014): Comment created by flip101: My colleague told me that it was his mistake somehow, so i don't know how valid this really is !!!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3984