You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collapse $scoped_vars + $mangled_vars into a single $vars param
Adds DEEPCLONE_HYDRATE_MANGLED_VARS flag. $vars is scoped per-class by
default; pass the flag to interpret it as the flat mangled-key array
(array) $obj produces. Mixed-mode (scoped + mangled merged in one call)
is removed — split into two calls if needed.
Footgun guard: a NUL-prefixed key at the top level of $vars in scoped
mode raises ValueError pointing at the missing flag.
|`DEEPCLONE_HYDRATE_CALL_HOOKS`|`ReflectionProperty::setValue` — invoke set hooks |
106
121
|`DEEPCLONE_HYDRATE_NO_LAZY_INIT`|`ReflectionProperty::setRawValueWithoutLazyInitialization` — skip the lazy initializer; realize the object when the last lazy property is set |
122
+
|`DEEPCLONE_HYDRATE_MANGLED_VARS`| interpret `$vars` as a flat mangled-key array (above) |
107
123
108
124
`DEEPCLONE_HYDRATE_CALL_HOOKS` and `DEEPCLONE_HYDRATE_NO_LAZY_INIT` are
109
-
mutually exclusive. `deepclone_from_array()` always uses the default
110
-
setRawValue semantics, mirroring `unserialize()`.
125
+
mutually exclusive; `MANGLED_VARS` composes with either. `deepclone_from_array()`
126
+
always uses the default setRawValue semantics, mirroring `unserialize()`.
111
127
112
128
### Forgiving payload handling
113
129
@@ -140,19 +156,24 @@ strict-type errors. They run under every mode unless noted:
140
156
enum-typed properties accordingly receive the enum case, not the
141
157
raw scalar.
142
158
143
-
The special `"\0"` key sets the internal state of SPL classes. In
144
-
`$scoped_vars` it goes inside a scope entry; in `$mangled_vars` it is a
145
-
flat key:
159
+
The special `"\0"` key sets the internal state of SPL classes. In scoped
160
+
mode it goes inside a scope entry; in `MANGLED_VARS` mode it is a flat key:
0 commit comments