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
Drop scoped mode — mangled-only is now the only shape (v0.5.0)
deepclone_hydrate() now interprets $vars exclusively as a flat
mangled-key array; the per-class scoped shape is removed along with
DEEPCLONE_HYDRATE_MANGLED_VARS. PRESERVE_REFS shifts from (1<<3) to
(1<<2), filling the vacated slot.
Also bundled follow-ups surfaced by review:
- deepclone_hydrate: reject the SPL "\0" key on classes that don't
support it; reject malformed SPL payloads (odd-count pairs for
SplObjectStorage, >3 ctor args for ArrayObject/ArrayIterator);
cache the offsetSet lookup across SplObjectStorage iterations;
gate the null → uninitialized shortcut on
zend_lazy_object_initialized(obj) so lazy objects don't bypass
the Reflection-based write path.
- deepclone_from_array: cross-validate objectMeta wakeup flags
against states entries (positive → __wakeup, negative →
__unserialize), rejecting impossible meta like [0, 999] or
[0, -123] that used to be accepted silently; route writes to
undeclared prop names on non-stdClass objects through
zend_update_property_ex() to respect overridden write handlers;
throw on out-of-range obj_id in "properties" entries (was
silently skipped); replace the per-object obj_classes[] pointer
scan with a direct class_id index, dropping an O(N × K) step.
|`DEEPCLONE_HYDRATE_CALL_HOOKS`|`ReflectionProperty::setValue` — invoke set hooks |
141
129
|`DEEPCLONE_HYDRATE_NO_LAZY_INIT`|`ReflectionProperty::setRawValueWithoutLazyInitialization` — skip the lazy initializer; realize the object when the last lazy property is set |
142
-
|`DEEPCLONE_HYDRATE_MANGLED_VARS`| interpret `$vars` as a flat mangled-key array (above) |
143
130
|`DEEPCLONE_HYDRATE_PRESERVE_REFS`| preserve PHP `&` references from `$vars` onto the target property slots; by default, references are dropped (dereferenced) on write |
144
131
145
132
`DEEPCLONE_HYDRATE_CALL_HOOKS` and `DEEPCLONE_HYDRATE_NO_LAZY_INIT` are
146
-
mutually exclusive; `MANGLED_VARS` and `PRESERVE_REFS`compose with either.
133
+
mutually exclusive; `PRESERVE_REFS`composes with either.
147
134
`deepclone_from_array()` always uses the default setRawValue semantics,
148
135
mirroring `unserialize()`.
149
136
@@ -185,24 +172,18 @@ strict-type errors. They run under every mode unless noted:
185
172
enum-typed properties accordingly receive the enum case, not the
186
173
raw scalar.
187
174
188
-
The special `"\0"` key sets the internal state of SPL classes. In scoped
189
-
mode it goes inside a scope entry; in `MANGLED_VARS` mode it is a flat key:
175
+
The special `"\0"` key sets the internal state of SPL classes:
0 commit comments