Re-registers each captured handle AT THE SAME INTEGER ID.
Ascending id order, and index.id is raised to the highest one seen. Both matter: the PHP heap
holds the integers, so an id that lands anywhere else is a handle pointing at the wrong object --
which does not throw, it silently calls something else. Leaving index.id low is the same defect
one step later, because the next add() would hand a fresh object an id the heap already owns.
Failures are collected rather than thrown so the caller can refuse the restore BEFORE the memcpy
and name every bad handle at once, exactly as replayStreams does for descriptors.
Re-registers each captured handle AT THE SAME INTEGER ID.
Ascending id order, and
index.idis raised to the highest one seen. Both matter: the PHP heap holds the integers, so an id that lands anywhere else is a handle pointing at the wrong object -- which does not throw, it silently calls something else. Leavingindex.idlow is the same defect one step later, because the nextadd()would hand a fresh object an id the heap already owns.Failures are collected rather than thrown so the caller can refuse the restore BEFORE the memcpy and name every bad handle at once, exactly as
replayStreamsdoes for descriptors.