Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99655 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27427 invoked from network); 28 Jun 2017 10:59:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jun 2017 10:59:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.20 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.20 mout.gmx.net Received: from [212.227.17.20] ([212.227.17.20:56202] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 96/51-07609-60C83595 for ; Wed, 28 Jun 2017 06:59:20 -0400 Received: from [192.168.2.110] ([79.243.122.61]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lmazv-1dyPVi3dfH-00aDRR; Wed, 28 Jun 2017 12:59:14 +0200 To: Rasmus Schultz , PHP internals References: Message-ID: <7b10b263-8090-62e7-bd9c-5e65e50dd85c@gmx.de> Date: Wed, 28 Jun 2017 12:59:16 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:MIanpXz0iFYHeScvvEIJpk5wV66rBJZvJeS67muA5ToGTyDEZ2h /P2sw5KE8qzRTlDMdLjWJ37yO/oB5PpxZKj3+RRerOjvQ3o0CMyOy1cyh57mGow3VIzsfRv jm05L+J4WdPPGgSmRzjpDNGkvRNAm89L1qvsEZwmsTmGVJyXbHuBfQLi0YaeAhbBX0LDQoK lvQRgsw7voJcttUkx8Ipw== X-UI-Out-Filterresults: notjunk:1;V01:K0:GJyNQz3mDi4=:usKuOcdz/7ObgQsbV+xUba nYsxmafhtYeO7QBVBmEemAEn6gq0DlUZ+imVchliYpbH3l5dOH+zsNSr5ecmu2iqVCeN4Mxyw pNxZnwIow2nvuwJuIcw0E9U/V5gWGtfoAbM2OHtcHrr5z9XlQKUkEzYHQv4G5IuimPmqCJRlY pFl31WElO42y8WM7eSz1E/A9j9qpc02qIFNUlb86qulSu/78+bjfziNAM1XZTGLnu2ZDJDtiK f/ioZX6a/PNFSmarfYEC4m1KD5lcovWPmd4v7DEpTX/3LAV1aps/YrgExR1cyh2s81M0T3WdN 5PseExKB3E7Ad8uQ9MLRa5J7MEr7joKWCXMWgCdPRr7XZj7qxBeUc2PXeegUAYcBQpvuE62co qLR4bglzYiqvPVBsWYfK3qlRu2MSONMKJDfVijh+Ktuu9/rkEEBJTEoA5ivMoAx0s9I+EKbw2 onVYdzda0kHR3IEEw1QZHUprdkTjKreTcNOFthwP3cnZk06FroV5n8O3Zeqaf/UkJKbsF/2RC Y9xnD+M79w0HAew7OQy4yqlW/4Rfv/oMs0H4Fg18rQ8TRQlN/6OuHjIyFI6Lt+e9i3YqCyvcq /wUxKWGfuVyVPyHDcWH6/wUVFlpzPAqR+ZbVIMOoURAMMQEuecjZXpVyNJfdnw1e59i+xx64D RBHf1fod6sGyOGopc0U3w46aZtg9fa3Cdt29el9qFbYzn+JbXx8L92AOb0KwgKJbmc6xs3L/7 qI8Aq2xzu0MGji9ATaiNpZ2BTwos2ZGrN2ZrsRbPp7cLCfm7/y0mB/CS7p96NeWkEwca46X8+ 7U4CRSC Subject: Re: Binary (msgpack) serialize/unserialize From: cmbecker69@gmx.de ("Christoph M. Becker") On 28.06.2017 at 11:04, Rasmus Schultz wrote: > Back in 2014 there was an informal proposal on the mailing list to replace > PHP serialization with an efficient binary (msgpack) format. > > https://www.mail-archive.com/internals@lists.php.net/msg69870.html > > As argued back then, breaking serialize() and unserialize() is unacceptable > for many reasons. > > Meanwhile, the default session-storage, third-party cache libraries, etc. > continue to use serialize() and unserialize() with better options being > available only outside of the standard PHP run-times. > > Why don't we either: > > 1. adopt msg_pack() and msg_unpack() from the PECL package as standard > functions, or > > 2. add a new pair of functions, e.g. bin_serialize() and bin_unserialize() > to supersede the existing functions > > Or possibly both - that is, alias the pack/unpack functions with names > indicating they supersede the old un/serialize functions, but document the > new bin_* functions are using "an unspecified internal format". This way, > people can elect to use msgpack binary format now and in the future, or > elect to use msgpack now and possibly a different format in the future. > > Optionally the bin_* functions could lead with a version byte (or maybe a > 4-byte header) allowing backwards compatibility with future binary formats. > This way we don't risk ending up in the same situation again in 10 years if > we realize msgpack is bad for serialization for any reason. > > There are many other uses for a set of efficient (space and time) > un/serialization functions, for example when packing small payloads > (checksums, image dimensions, etc.) into URLs, when persisting data in > cookies, etc. > > Thoughts? See also . -- Christoph M. Becker