[php-src] PR #25598: ext/simplexml: Resolve constants of user classes before instantiation
| From: | iliaal | Date: | Thu, 19 Nov 2026 16:16:19 +0000 |
| Subject: | [php-src] PR #25598: ext/simplexml: Resolve constants of user classes before instantiation | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40819@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25598
Author: iliaal
simplexml_load_string(), simplexml_load_file() and simplexml_import_dom() skip the constant
resolution that
new does, so a class_name class whose property defaults use constants
gets the unevaluated constant expression, and under opcache the call segfaults. Resolve the
constants before any XML is parsed or imported. In simplexml_import_dom() this has to precede
php_libxml_import_node(), as an autoloader run during evaluation can free the node.