On Thu, Mar 21, 2019 at 3:39 PM Nikita Popov <nikita....@gmail.com> wrote:

> On Tue, Feb 12, 2019 at 4:00 PM Nikita Popov <nikita....@gmail.com> wrote:
>
>> Hi internals,
>>
>> The ext/xml extension currently has GC issues, see
>> https://bugs.php.net/bug.php?id=76874. The tl;dr is that uses of
>> xml_parser will usually result in a cyclic structure, but resources do not
>> support cycle GC. This means that the user is required to take care of
>> breaking GC cycles manually, which is very unusual for PHP.
>>
>> I would like to port the xml extension from using a resources towards
>> using an object, which is fully GC integrated. This is implemented in
>> https://github.com/php/php-src/pull/3526.
>>
>> An XmlParser class is used instead of a resource. The class is final and
>> cannot be manually constructed. It is still used with the normal
>> xml_parser_* APIs. This is intended as an internal representation change,
>> not a conversion to OO APIs. The xml_parser_free() method becomes
>> effectively a no-op and may be deprecated in some future version.
>>
>> This change is intended for PHP 7.4. While it is technically BC breaking
>> (in that code that goes out of the way to use is_resource or similar may
>> break), but we've done a couple of these resource->object migration in
>> minor versions in the past (ref
>> https://wiki.php.net/rfc/operator_overloading_gmp and
>> https://wiki.php.net/rfc/hash-context.as-resource).
>>
>> Any thoughts?
>>
>> Regards,
>> Nikita
>>
>
> I'd like to move forward with this. Jakub requested this change to be
> postponed to 8.0 in
> https://github.com/php/php-src/pull/3526#issuecomment-469796632 to
> minimize BC issues. As 8.0 is close I'm okay with just doing that, this is
> not super urgent for me.
>
> Is there anything else that needs to be resolved here, or is this good to
> go for PHP 8.0?
>
> Nikita
>

As there haven't been further comments here, I've merged this change for
PHP 8 only.

Nikita

Reply via email to