Collection class should implement `Countable` and `JsonSerializable` interfaces for proper PHP interoperability. **Problem:** - `count($collection)` doesn't work correctly without `Countable` - `json_encode($collection)` produces `{}` without `JsonSerializable` **PR:** https://github.com/hiqdev/php-collection/pull/3
Collection class should implement
CountableandJsonSerializableinterfaces for proper PHP interoperability.Problem:
count($collection)doesn't work correctly withoutCountablejson_encode($collection)produces{}withoutJsonSerializablePR: #3