Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105147 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 49304 invoked from network); 8 Apr 2019 17:31:00 -0000 Received: from unknown (HELO mail-it1-f175.google.com) (209.85.166.175) by pb1.pair.com with SMTP; 8 Apr 2019 17:31:00 -0000 Received: by mail-it1-f175.google.com with SMTP id u65so21289614itc.2 for ; Mon, 08 Apr 2019 07:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=5qmKtt3uU73qg4YZB7IzTL8UzbIMza8yAk04LFm0VXc=; b=glZ1sBC47ND4Whr4DfkN9A+vdlnaiVjImldACFbbRjv4QUKdsck/LbXxPRge76Xy9r aFCxzoqqG7HczEJydZxukHYBR6ip98DQWfwmhRyvZHzpHGfTGxwSVTpfCKrgrwBNgoI8 zUv2a3xvH1zYCRIB/vcKkm0hFbgfcnjUnooE1bAQ+Ey5OL22cj6gJPDG4G1FJOWehXRE ydgxGiAMZNPmG5TSX2+UMpugcQ0ODTuyWbtEBVL/O2VdhntgK4z2XsNl2h2bFriE0o8S hXglkCmNjuqXeaL9HdcvB1094dSoF1Zhtquj/VXAtm3fmNYNJA7IEkHAnyTPnEhGXibr +uOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=5qmKtt3uU73qg4YZB7IzTL8UzbIMza8yAk04LFm0VXc=; b=WyXv2HMHxvQKP1CSCa8fCFdt56ImUOkTYRovYudo7qTBf8ZkCyJFutYPoISZoMCoph Uu98S4EvNAF9DBq6Y7nGUZl9eWs01p/fw6GmYopcoZ7DXXYk3Wb/3ZpceU0qwGYJYbxe FFgjWgpDhmYKIpNqaoPP/KJbyeP70+vQZWnRbzu0wAUPooRQE11puSZgD8Sdegt13ZuE WpGLtY6VleeZ5rwAzqlTt3ufDMUlR5JGITi4jQxDfzn6ImYqlH9ZM2nmr32U4nFJjoXE VA6WuH4FpQjzFFN7jbAs3iJPrX1OhSH58hi3ZnEPJJ3QMTbjVJTgHwR3h/ucM/iRI3Qx 4PrA== X-Gm-Message-State: APjAAAUAUiqtGYTtllacZmZyLfHaLZrJN9+fUeqq3UGsTgooaZKkTWzE DEN+YOvF4HM30R3prAzzWfVInLOn4tXp+prRS5NoE4QbabY= X-Google-Smtp-Source: APXvYqyXWfHbj79hdKEqP/JlP0GnNUoc0ovFRe80QvLxpW04ERbbcn4w0afoSB5hsQ9qyHErgDcozijWYmcYuIPtEBo= X-Received: by 2002:a02:ad05:: with SMTP id s5mr20526564jan.71.1554733659486; Mon, 08 Apr 2019 07:27:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 8 Apr 2019 16:27:23 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000007e7ef0058605a327" Subject: Re: Convert ext/xml to use an object instead of resource From: nikita.ppv@gmail.com (Nikita Popov) --0000000000007e7ef0058605a327 Content-Type: text/plain; charset="UTF-8" On Thu, Mar 21, 2019 at 3:39 PM Nikita Popov wrote: > On Tue, Feb 12, 2019 at 4:00 PM Nikita Popov 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 --0000000000007e7ef0058605a327--