[doc-en] master: cloning: visibility applies to all properties, readonly is orthogonal (#5854)
| From: | Louis-Arnaud via GitHub | Date: | Thu, 10 Sep 2026 18:13:14 +0000 |
| Subject: | [doc-en] master: cloning: visibility applies to all properties, readonly is orthogonal (#5854) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23743@lists.php.net to get a copy of this message | ||
Author: Louis-Arnaud (lacatoire)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-09-10T20:13:11+02:00
Commit: https://github.com/php/doc-en/commit/09c650422aec6f59dca08d1c65eaa633d391a525
Raw diff: https://github.com/php/doc-en/commit/09c650422aec6f59dca08d1c65eaa633d391a525.diff
cloning: visibility applies to all properties, readonly is orthogonal (#5854)
Changed paths:
M language/oop5/cloning.xml
Diff:
diff --git a/language/oop5/cloning.xml b/language/oop5/cloning.xml
index 91e31b4b1551..fde59faeb549 100644
--- a/language/oop5/cloning.xml
+++ b/language/oop5/cloning.xml
@@ -168,10 +168,11 @@ echo (clone $dateTime)->format('Y');
<simpara>
The overrides are applied after
<link linkend="object.clone">__clone()</link> has run, and they honour
the
- visibility of the properties: a
- <link
linkend="language.oop5.properties.readonly-properties">readonly</link>
- property can only be overridden from a scope that is allowed to write it,
- which makes the function suited to methods returning a modified copy.
+ visibility of all properties.
+ <link
linkend="language.oop5.properties.readonly-properties">Readonly</link>
+ properties can be updated on the copy even if they were already set on the
+ original object, which makes the function suited to methods returning a
+ modified copy.
</simpara>
<example>