Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122355 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30495 invoked from network); 9 Feb 2024 17:39:55 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Feb 2024 17:39:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1707500449; bh=bZeJVs9GUBR6Rjgk3pS+G504ab1t1dPh9g9QThEubdI=; h=In-Reply-To:References:Date:From:To:Subject:From; b=ndt1YHWMSCLDUxmPNrhfMZMXOWREX4G0S7Rt61IjCTMYmoic6tvQwkWzMB76XjHCm UQlUHdp1Br44r/mcGSz6O8tt8+Y7ADCPtW3JwMyBXS0nSYqlI+lbFTujUlDskFXthA +bWRlwITLh/KcUpaTqagssOIBVD7KacbUp2LwwIJv0R+51VZYy/1TGSKTU/8HyhTZX P6L415hDBZzt3pEV5x/RRFSZ+5TSKGfjFoWn/l8A8gIWhA6aqWuV0FTEeqpLmic2hN ++g/iitqChH/9ef0Jgx2GGntjbpBz6MLBt9rT+o8TTwr9sCVQyfv3mtGlfDZjJ4tBQ q7+OwBgT5acUA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3A9F8180068 for ; Fri, 9 Feb 2024 09:40:48 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,HTML_MESSAGE,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NEUTRAL autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 9 Feb 2024 09:40:47 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 492975C0179 for ; Fri, 9 Feb 2024 12:39:53 -0500 (EST) Received: from imap50 ([10.202.2.100]) by compute3.internal (MEProxy); Fri, 09 Feb 2024 12:39:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1707500393; x=1707586793; bh=bZeJVs9GUBR6Rjgk3pS+G504ab1t 1dPh9g9QThEubdI=; b=mp/pa5/8JHnq4v6kR8oM6h+LafFHoALfUmFUDxYcTD0Q ypEQ9BJvF4eX36VoZi89MLnT1OnxYknb9QXatPltPKpYl4CCNX0xxtjV5EZgaVyc nQkhlgQjsLWfyXehmgN9TX+C8QjWaBqg+7msY+dZ8h3NFuh9o3HPOhK7xN0erG6I 7OLm5GOk4ljzEZefVDwPiNJscX3lT3io5G3y357eGgbMcgdD1/Ptx+F98PVzFp5b DsgFWDC66h991gw5bfVqMwdJrAqrh6zrFxWW1wWIyAq5voaTgGba0nSicLdoMTnE gFP/G35BfHF4Wk1wzW6vJ42y79eWa509JHYBPGVrtw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrtdeigddutddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsegrtd erreerredtnecuhfhrohhmpedfvegrshhpvghrucfnrghnghgvmhgvihhjvghrfdcuoehl rghnghgvmhgvihhjvghrsehphhhprdhnvghtqeenucggtffrrghtthgvrhhnpefglefhtd eukedtteefuedvtedvkedtveefveelveeihefgvdfhheetvdffieethfenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghnghgvmhgvihhjvg hrsehphhhprdhnvght X-ME-Proxy: Feedback-ID: id4f946ef:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id D65DC1700096; Fri, 9 Feb 2024 12:39:52 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-144-ge5821d614e-fm-20240125.002-ge5821d61 MIME-Version: 1.0 Message-ID: <854260be-07ae-4df0-b2bc-e172042069bb@app.fastmail.com> In-Reply-To: References: Date: Fri, 09 Feb 2024 18:39:00 +0100 To: "Levi Morrison" Content-Type: multipart/alternative; boundary=198d7b7eb0ad4b7ab9cb9d2e2ff5478f Subject: Re: [PHP-DEV] Why are serialized strings wrapped in double quotes? (s::"") From: langemeijer@php.net ("Casper Langemeijer") --198d7b7eb0ad4b7ab9cb9d2e2ff5478f Content-Type: text/plain On Tue, Feb 6, 2024, at 21:19, Sanford Whiteman wrote: > 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? > Instead we need to be aware of the leading and trailing " in our state > machine but I'm not sure what the advantage is. Dunno why, but is has made my life much easier. I've seen many situation where serialized data was converted from CP1252 to UTF8. Then the string length changes and unserialization leads to an error condition. Without the quotes possibly many cases would go undetected. > Was this just to make strings look more 'stringy', even though the > format isn't meant to be human-readable? In my mind the format is a nice pragmatic middle between reasonably efficient, reasonably robust, too feature-complete (too many allowed_classes) and somewhat human readable. At least enough for incidental debugging or manual tinkering. --198d7b7eb0ad4b7ab9cb9d2e2ff5478f--