An internal class has two ways to achieve a special feature:
for a class to be userland-friendly AND fast it must:
There are one problem with how the count_elements handler is defined/used: if an internal class extends Countable, it will call its count() method regardless of the handler pointer.
There are two main reasons why it's a problem:
The patch consists of changing the order of the checks to fix that problem:
http://patches.colder.ch/php-src/array-1.308.2.21.2.37.2.34.patch?markup http://patches.colder.ch/php-src/array-1.454.patch?markup
Internal classes that define a count_elements handler will have to be fixed.