[php-src] PR #25601: ext/dom: Resolve constants of a node class when registering it
| From: | iliaal | Date: | Thu, 19 Nov 2026 16:36:14 +0000 |
| Subject: | [php-src] PR #25601: ext/dom: Resolve constants of a node class when registering it | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40823@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25601
Author: iliaal
A class registered with registerNodeClass() whose constant expressions cannot be evaluated, such as
public $x = UNDEFINED;, crashes the first time DOM creates a node of that class,
because php_dom_instantiate_object_helper() does not check object_init_ex() for failure. Evaluate
the constants in registerNodeClass() and throw there, as is done for abstract classes. As a result,
registering such a class throws where it previously succeeded until a node was created.