[php-src] PR #23596: dom: report the DOMXPath callback node list to the cycle collector

From: Date: Sun, 06 Sep 2026 15:07:43 +0000
Subject: [php-src] PR #23596: dom: report the DOMXPath callback node list to the cycle collector
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-38346@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/23596 Author: iliaal php_dom_xpath_callbacks_get_gc() traced php_ns and namespaces but not node_list, which holds the nodes passed to and returned from php:function callbacks. A cycle from a DOMXPath through node_list to a node and back to the same DOMXPath was invisible to the collector, so it was never freed. node_list is still cleared at object destruction rather than at the end of each evaluation. Clearing it eagerly is not safe, because a callback can run a nested query()/evaluate() on the same object and the inner call would free wrappers the outer evaluation is still using.

« previous php.git-pulls (#38346) next »