3 ms·
https://github.com/thephpleague/commonmark/blob/master/src/Util/ArrayCollection.php#L112 https://github.com/thephpleague/commonmark/blob/master/src/U... What is
by _RPM 12y ago
https://github.com/thephpleague/commonmark/blob/master/src/Util/ArrayCollection.php#L112 https://github.com/thephpleague/commonmark/blob/master/src/U... What is the Point of abstracting away "empty?"
- alexbilbie 12y agoI guess because you're asking a question of the object - "is this empty?"
- deleted 12y ago[deleted]
- Rygu 12y agoIt already implements count() and the corresponding interface so it's possible to write count($collection) as if you're writing $collection->count(). It's a valid question why this type of object needs two methods for checking the same property.
- hrtyl 12y agoPHP does not have an interface for empty. count and empty are not equivalent. empty should be called on the underlying array and not the object.