Commit b40cae2b1f5 for php.net
commit b40cae2b1f5979bc3a838fa425880fde1d5ac070
Author: David CARLIER <devnexen@gmail.com>
Date: Sat Apr 18 22:47:41 2026 +0100
[ci skip] ext/dom: NEWS/UPGRADING notes for asymmetric visibility on readonly properties. (#21809)
diff --git a/NEWS b/NEWS
index 2000d5b4710..8c2b185d328 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,11 @@ PHP NEWS
- DOM:
. Removed LIBXML_XINCLUDE from valid options for XMLDocument,
as it was a no-op. (ndossche)
+ . Readonly DOM properties are now declared with asymmetric visibility
+ (public private(set)). ReflectionProperty::isWritable() reports them
+ correctly, and external writes raise "Cannot modify private(set)
+ property" instead of the previous readonly modification error.
+ (David Carlier)
- Fileinfo:
. Fixed bug GH-20679 (finfo_file() doesn't work on remote resources).
diff --git a/UPGRADING b/UPGRADING
index 10a63f6b03a..f7874c2d347 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -19,6 +19,16 @@ PHP 8.6 UPGRADE NOTES
1. Backward Incompatible Changes
========================================
+- DOM:
+ . Properties previously documented as @readonly (e.g. DOMNode::$nodeType,
+ DOMDocument::$xmlEncoding, DOMEntity::$actualEncoding, ::$encoding,
+ ::$version) are now declared with asymmetric visibility
+ (public private(set)). Attempts to write to them from outside the
+ class now raise "Cannot modify private(set) property <class>::$<prop>
+ from global scope" instead of the prior readonly modification error.
+ ReflectionProperty::isWritable() also reports these properties
+ accurately.
+
- GD:
. imagesetstyle(), imagefilter() and imagecrop() filter their
array arguments types/values and raise a TypeError/ValueError