Skip to content

Commit 09c6504

Browse files
authored
cloning: visibility applies to all properties, readonly is orthogonal (#5854)
1 parent dd5db7c commit 09c6504

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

language/oop5/cloning.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,11 @@ echo (clone $dateTime)->format('Y');
168168
<simpara>
169169
The overrides are applied after
170170
<link linkend="object.clone">__clone()</link> has run, and they honour the
171-
visibility of the properties: a
172-
<link linkend="language.oop5.properties.readonly-properties">readonly</link>
173-
property can only be overridden from a scope that is allowed to write it,
174-
which makes the function suited to methods returning a modified copy.
171+
visibility of all properties.
172+
<link linkend="language.oop5.properties.readonly-properties">Readonly</link>
173+
properties can be updated on the copy even if they were already set on the
174+
original object, which makes the function suited to methods returning a
175+
modified copy.
175176
</simpara>
176177

177178
<example>

0 commit comments

Comments
 (0)