2016-11-13 18:34 GMT+01:00 Christoph M. Becker <cmbecke...@gmx.de>: > Hi! > > In the discussion on PR #2185[1] we've stumbled upon the issue of > internal classes implementing a count_elements handler (but not the > Countable interface). > > Is it possible to detect this in userland? If not, I would suggest that > we introduce something like is_countable(), so users can check whether > count() may be safely called on a given value. > > [1] <https://github.com/php/php-src/pull/2185> >
How about just making those classes implement the interface instead? Regards, Niklas