I'm working on this old code, and ran across this - which fails:
preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $sObject);
It tells me that preg_replace e modifier is deprecated, and to use preg_replace_callback instead.
From what I understand, I am supposed to replace the 's:'.strlen('$2').':\"$2\";'
part with a callback function that does the replacement on the match.
What I DON'T quite get, is exactly what the regexp is doing that I'll be replacing. It's part of a bit to take php serialized data stuffed in a database field (dumb, I know ...) with broken length fields and fix them for reinsertion.
So can anybody explain what that bit is doing, or what I should replace it with?
preg_replace_callback()
as the output – Manual