Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99653 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20588 invoked from network); 28 Jun 2017 09:04:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jun 2017 09:04:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.192.173 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.192.173 mail-pf0-f173.google.com Received: from [209.85.192.173] ([209.85.192.173:35620] helo=mail-pf0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 96/90-07609-D1173595 for ; Wed, 28 Jun 2017 05:04:31 -0400 Received: by mail-pf0-f173.google.com with SMTP id c73so30288143pfk.2 for ; Wed, 28 Jun 2017 02:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mindplay-dk.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=5/sm4XK8tYkGn81Y7+v6kPviGlLMpFgcpkV1FCC/eyo=; b=t7CEPtBC2r37fstwtI3AhHHzfOzvxYa1Arr0cQIct8HSUlwfoOOC5wFVQdEc3RrHqh boT6rvLjPIJFLqAjWD0THWdWE5Td+ys7ZjMChv/+xYlzYavWshc7/Q+tzYMzQGR4/Kyc xHGfqVRUZQmtCLi6EURgG4MOp9naoyKwDbp8Po+4eizJmn7eSScC3BD9oeKtQqS3h2d7 PwQMSan9kyEwKclTlDVRnUwPgpDZIezQ0pLJsly0TaqXADQC0oWdGc0WA8Y4L0idjZTQ Y9myfQjAttRxpnlsAAvCQSitxfqXz/FdMWAqFI73yWGO7WEiVUAfFErHt5NYBzHuO243 ua4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=5/sm4XK8tYkGn81Y7+v6kPviGlLMpFgcpkV1FCC/eyo=; b=i+BGcu9vfo/MCMZhdhqgtBSf0XhH2OZ705bJjuFBa6QDiBjm7B+/d+Qj0hMpuQ6har VaI+qMvH4iJ50T448xzRhPYLyi/UuUE/CwNJH0q3aYOnvEwAFVKZbi1wLsfQMnNjMDkB osiyBA1IL0D1xHHCo0z6/+YimD6GwQ04pzIXSSZOlStCYCF9XJYIxCFR3HJnZgsYv8+6 cYSNV9WgEU7aBRdNylVqCgSpkekT6ypsCCRNCvzkjy1tdQ0nmI4A8BVsNmgti0TK9mXS DBgGhkFWpLbL+AL76ikF7kMYl8XcjYbiQ1tidqB1aQ0DP94cBKAtztw8pZCyJ3UyaBuT Tp9w== X-Gm-Message-State: AKS2vOwPF79Ez8GWLfafxAScTjKkmpG2xI+7vn49wJP7LRPp2GUJRVMd CEQtgsD2/6Im+pWw9US6GQOFYlmH01cQKYMRXQ== X-Received: by 10.84.217.204 with SMTP id d12mr10534541plj.208.1498640666764; Wed, 28 Jun 2017 02:04:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.138.36 with HTTP; Wed, 28 Jun 2017 02:04:26 -0700 (PDT) Date: Wed, 28 Jun 2017 11:04:26 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="f403045cd28e96be3b0553017814" Subject: Binary (msgpack) serialize/unserialize From: rasmus@mindplay.dk (Rasmus Schultz) --f403045cd28e96be3b0553017814 Content-Type: text/plain; charset="UTF-8" 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? --f403045cd28e96be3b0553017814--