Re: How to detect classes with a count_elements handler in userland?
| From: | Christoph M. Becker | Date: | Thu, 17 Nov 2016 11:59:49 +0000 |
| Subject: | Re: How to detect classes with a count_elements handler in userland? | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-96947@lists.php.net to get a copy of this message | ||
On 16.11.2016 at 22:02, Nikita Popov wrote:
> On Mon, Nov 14, 2016 at 2:22 PM, Christoph M. Becker <cmbecker69@gmx.de>
> wrote:
>
>> On 13.11.2016 at 22:10, Craig Duncan wrote:
>>
>>>> How about just making those classes implement the interface instead?
>>>
>>> Christoph pointed out that there may be classes in extensions that use
>>> count_elements.
>>
>> Furthermore, letting those classes implement Countable could break BC.
>
> How would this break BC?
>
> SXE even already has a count() method, and count_elements respects
> overrides of that method. Clearly SXE is supposed to implement Countable,
> it was simply forgotten.
Thinking about it, we most likely don't have to be concerned with some
*theoretic* BC break (such as
!(instance of Countable)).
Thanks!
--
Christoph M. Becker