I made an object that was suposed to represent an array, but with a few methods. So I made it implement the native interfaces: IteratorAggregate
and Countable
. That way you can foreach
and count
it. So far so good.
But now I want it to evaluate like an array as well. So, if count($object)
is zero, if($object)
is suposed to evaluate as false
. Is there a Comparable
interface or something?