Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122353 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14918 invoked from network); 9 Feb 2024 11:56:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Feb 2024 11:56:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1707479848; bh=4A9OmADa4yprCwlHdctKb4vIj6p7NsowrjMJO/I3wfg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=blY/EnPlVIA1KogBsqsVa05/4xjo/1NCtnGXR0FUD6iHT/KKPfpLwwTCbihJUJBph JqWX6am0lvazAg12bxPgvajzG50/gnYgZBZd2bfjVmLGrHKp59cGgcAf3Yaz/V0rZ4 Hz/4ywXIi8Dl9aeQg/UJq8s/7OshobCsB4qLkUcH3aRlOcKo64EMCLhrXh8oZsAe0P Daj11FKxWnT9kHvmpbhuMH09EUDwQEunSGLIoS6grNtUV9tJoiDeXVpyGdmHleOdEV wNDsc1jVh4AT0X/KUZf4ADAkV87tbXy8z64UFbQFymt+3mwcRaPIer6P+vn4DgrYpT VblPO6y9HzyPw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5AD33180059 for ; Fri, 9 Feb 2024 03:57:28 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.43]) (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 03:57:27 -0800 (PST) Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-59a9a737273so235392eaf.1 for ; Fri, 09 Feb 2024 03:56:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707479793; x=1708084593; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4A9OmADa4yprCwlHdctKb4vIj6p7NsowrjMJO/I3wfg=; b=R8lNHW0URTxV3fq4Zox8yz5eHJYmYWAy28CYc+2lcA0/HldM0vZ+QRuoR3chhzKP5f lccy4QoVO2zS3fgEM9kQlTAfFLUzQIVesQKqcF1dx90hDMGgHVA87TebM8kDLZ3fJPti 43U7zCzxoDRjVf6C+Tw4Xy7wXZLCxepWyFk4vEpyN+bddAhhNHKfnpFO2EmcPlTW15EW b/GhKy/fAQRpZcZPLjdLXcvsg6ZBznfL8B8POmSgRb6Aqzo67sxjCS0Z3EZj23hBBzth D+GU+fb9xcb49W/Mt+RP3RCla28DgkbzEvR6V1ek3gVJDDX95rJJUId6s/6lHqYCADSv dSeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707479793; x=1708084593; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4A9OmADa4yprCwlHdctKb4vIj6p7NsowrjMJO/I3wfg=; b=ovzS0zxqiGwujoepQU0uO+xm2BKbFfGNPP6hYV3tuCjB2Tt055ESIxOLIOCUxG9Kls suzR9c+LldTMO2O5TQFReqZ+89WgTCxPIcDQpSN9nOtTeG1NnqNASd6A3QiyiaZ7zLql drmub2EkGMyaoUZ1ZU3eheug8QoZ7ViNX3zp7qJpqqY6Qu210N7FecMQ5GVl7UhpiPBT vIDf/ZAjf3G2sPAL6KlSLbFvqo98qZrIJt58QAS1mK6JtIIWRLb/kYm2GA3wLWwEp0xg XGTCDujPjVk4Zf7uYJ1d+qrJk+O21qqFthYYdYSlV8FVeeyqiszBgeVIyusUIghRk2+q 8Hpg== X-Gm-Message-State: AOJu0Yyh5P0/U5CqF8V3JB9B5V/WEBXIKZ54IGLDT47S+VEG1Cfbg+4c v/hDGC4k3KCIQ6kQ8j1FbYII0DYNyT/thfmT4p08MyEe4GI+kPER7Q/gQ+WYqhuBv7fRcGKhfJQ htlSLdSZ2+zC4ZXYCPsuRsUfuH1s= X-Google-Smtp-Source: AGHT+IFkkktD0eZGt3a36SyRKwU/QQCAJDAnxfyQj4Wpg3Yu2dn/aj0OQuc9669ioiRbrpN1SUIU1igOfELF8atvlLw= X-Received: by 2002:a05:6820:611:b0:59d:347b:efab with SMTP id e17-20020a056820061100b0059d347befabmr164609oow.4.1707479793055; Fri, 09 Feb 2024 03:56:33 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 9 Feb 2024 12:56:22 +0100 Message-ID: To: =?UTF-8?Q?Micha=C5=82_Marcin_Brzuchalski?= Cc: 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: landers.robert@gmail.com (Robert Landers) On Fri, Feb 9, 2024 at 8:13=E2=80=AFAM Micha=C5=82 Marcin Brzuchalski wrote: > > czw., 8 lut 2024 o 20:10 Sanford Whiteman > napisa=C5=82(a): > > > Hi Micha=C5=82, > > > > Thursday, February 8, 2024, 2:58:52 AM, you wrote: > > ... > > >O3:Foo:5{s4:date;O17:DateTimeImmutable:3{s4:date;s26:2024-02-08 > > > > >08:41:10.009742;s13:timezone_type;i:3;s8:timezone;s16:Europe/Amsterdam= }s6:*foo;s11:Foo > > >bar > > > > >baz;s8:Foobar;i:123456789;s3:tbl;a4{i:0;i:123;i:1;b:1;i:2;d:1.1;i:3;s3= :baz}s8:*color;E12:Color:Yellow} > > > > > >This is still readable by humans and keep the size/length in all place= s > > >where needed. > > > > Amazing. To my eyes it's more readable too. > > > > Just wondering, while null is encoded just as N the booleans are encoded > with b:0 or b:1 > I can imagine this could also be just T and F > > > > Here's another one: leading numeral *implies* Integer 'i' (so only > > 'd', 'b' and 's' are necessary). Or maybe that goes too far. > > > I was there in the very first link you can spot it but also believe this > goes too far. > > All above already goes far beyond what you initially asked and I know tha= t. > I just like to share what can find. > > Cheers, > Micha=C5=82 Marcin Brzuchalski If I recall correctly, there is also a `\0` (null character) hiding in the serialized string as well. It's incredibly annoying when copy/pasting as sometimes it gets stripped out. It might be worth removing as well. Robert Landers Software Engineer Utrecht NL