This question on \'How to tell if a PHP array is empty\' had me thinking of this question
Is there a reason that count should be used instead of e
count() seems to work better with array-like interfaces that implement ArrayAccess/Countable. empty() returns true for these kinds of objects even if they have no elements. Typically these classes will implement the Countable interface, so if the question is "Does this collection contain elements?" without making an assumption about the implementation, then count() is a better option.