The only way I see after thinking a bit on this is sort of LZW algorithm
on variables. While serializing, keep serialized zval's in some list/hash,
and if you see some zval twice, with is_ref set, you mark it as
"referenced" in serialized data, pointing out which var it refers somehow
(maybe just with running number). I'm not sure it is going to work in
100% of cases, needs much thinking about that.
Does that imply that you´ll be thinking about that? It should be enough to get this information on serialize time, I can´t imagine one needs that information earlier...
regards
--
o----------0-¬---------O-·---¬----o---®-----o o O ° .
| http://www.kiffen.de | pRoteçt y0ur bRaín |0 O ° ¤ °
·
0°·³°²'²³-¹'³´³°^°³~³²³°'³²²¨³²^³¹³²°²³`³º³°Þ °
o © ° . ·
| psychedelic experience | gott@kiffen.de | O ° o °
o-¬--o--0-----©-·--O-----o-----0-¤----------o 0 ° · ° . ¤ ·