On Tue, Feb 6, 2024, at 12:19 PM, Sanford Whiteman wrote: > Howdy all, haven't posted in ages but good to see the list going strong. > > I'd like a little background on something we've long accepted: why > does the serialization format need double quotes around a string, even > though the byte length is explicit?
I enjoy spelunking in the history of the project, so I did some digging. It looks to me like Kris didn't quite get the history correct. Boris did propose a form of serialization first, but it looks like what became serialize() and unserialize() came into the project another way. https://marc.info/?l=php-general&m=90222513234434&w=2 The serialize() and unserialize() functions were first added in PHP 3.0.5 with that same encoding for strings that you're asking about. Here is the original proposal for adding the functions from Jani Lehtimäki: https://news-web.php.net/php.dev/1444 The were originally conceived as var_save() and var_load() and operated on files, but you can see the file format uses the same string encoding, although it used single quotes. It was committed to CVS by Stig here, but unfortunately the emails to the list didn't include newly-added files. https://news-web.php.net/php.dev/1540 I'm not sure if the old CVS history is preserved somewhere, but based on what appeared in 3.0.5, that format probably goes back to the beginning and it doesn't look like there was any on-list discussion about it. Jim -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php