Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122334 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99183 invoked from network); 7 Feb 2024 19:52:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Feb 2024 19:52:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1707335579; bh=CVTuAoJRbMSWEYeten8PYN5Mq2MzVtWHJVbvPCY1sxs=; h=In-Reply-To:References:Date:From:To:Subject:From; b=AGSEoAXWkMK6gX12HJfpT0tzuy3I+Sld0m6ia71UZpuoGb3byy5ZzJNeZgNgxGQPP GM68AAQotTW4Jtg1Be+TAowXW+7NC1kr6mPMH4pKIb3r/OSYYGKfoyfObkomBTIr79 /PBFqAt7MW5AdoBwRzFukl9WersrlT9mdIsCaLXKdR1S6Uos03xpn6wX1lc7uBRHfi UUAWZY3mylu2EsbGWKjD9nV2Enz+uO44YQkoEfhze19qJA3tT3aYQb4J0t8UelVMvz yIF9SaDoD5MdhzqpqJmYJ32skTxN9VToPNHxCSWXXpTdW/RLTSPfkV5rxUw2m+BLBT ZSLKK6bwZN55g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E0439180074 for ; Wed, 7 Feb 2024 11:52:55 -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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (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 ; Wed, 7 Feb 2024 11:52:55 -0800 (PST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 15F395C00AB; Wed, 7 Feb 2024 14:52:02 -0500 (EST) Received: from imap47 ([10.202.2.97]) by compute7.internal (MEProxy); Wed, 07 Feb 2024 14:52:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= trainedmonkey.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1707335522; x=1707421922; bh=CVTuAoJRbMSWEYeten8PY N5Mq2MzVtWHJVbvPCY1sxs=; b=QS85gsOPKs/fSKC3WedRwsT0hLcCPLSIGyco1 hlvyLJbROKC6dv7BgDXQq1DeHNqCsFfly3CmMkjDyKoVosbhKqLvMlwN2WFzTexY JyPKC+d0YdpotI9fdjnUYoyoxu/QitZgP4x3nMlND/MHyZQ9vH6LyVM2gWYx0qjl G6CQJukBwEG0qQv4Lah6Fk/2KGwO/PTFarHhdf+jSz2gJIb1IjEb7CxXzIlCiw+l LfDTNHswRjeW8s69Bnbp6p/jkx3tVfwFvWDEwNknffkL2NBCGugsnOsNOy8k7ZWX 9UhM25iTO9Ic1VL/NustYQtLuKNVTWaeRKTrsPqx6T4Q2n3EQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=1707335522; x= 1707421922; bh=CVTuAoJRbMSWEYeten8PYN5Mq2MzVtWHJVbvPCY1sxs=; b=C W38o56qCjrEruF4yI5hV/pBH/BoSCyTrWpw54l/oZ3scAYpd/6DsIu3vovdBKTu/ vt5Zy3/amn66pq07wO7vKQ7+vUwWFD6g9GkVZTcjArri7DwnncmCIUM0Rd5545a7 Da/88gxWgtjs7JrPr3KVQn0gTTb1IaiJbpSfaiK1Tobz+p2d3jBJWx7i1p2iirzU VEZEuamZRwFyZTZVruCRjhkTQbG2c5+vQJz0ev/2wJrSpPDX8lylP4uHxmsNQ+NA 0hsc1aivjY766Qd1lwpiT4yD8CN/lyWeT6PYLh8CNKS5fSldaiHHvnIQGbzuQ7EU Og9EhUasWXyHxb41+YI9A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrtddvgdduvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedflfhi mhcuhghinhhsthgvrggufdcuoehjihhmfiesthhrrghinhgvughmohhnkhgvhidrtghomh eqnecuggftrfgrthhtvghrnhepieffledthfegvddukeeuiedtfefhveeiteffueduveev jeeljeegleelieeihfeunecuffhomhgrihhnpehmrghrtgdrihhnfhhopdhphhhprdhnvg htpdhphhhprdguvghvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepjhhimhifsehtrhgrihhnvggumhhonhhkvgihrdgtohhm X-ME-Proxy: Feedback-ID: ia2404087:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 8687FA6007B; Wed, 7 Feb 2024 14:52:01 -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: <2597df91-56c5-4e53-82c3-26a1ac6bb38b@app.fastmail.com> In-Reply-To: References: Date: Wed, 07 Feb 2024 11:51:41 -0800 To: "Sanford Whiteman" , "PHP Internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Why are serialized strings wrapped in double quotes? (s::"") From: jimw@trainedmonkey.com ("Jim Winstead") 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 stron= g. > > 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 di= d propose a form of serialization first, but it looks like what became s= erialize() and unserialize() came into the project another way. https://marc.info/?l=3Dphp-general&m=3D90222513234434&w=3D2 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=C3=A4ki: 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 th= e 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