Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128707 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id D0E4E1A00BC for ; Tue, 16 Sep 2025 14:50:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1758034147; bh=VR22F64PYgfo7OQrYB7DdDBaBDyjpJKIiaest5SC2Kw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=XYjWncKcQAPSP7jUQzsk9rSjh8PL9gqtYQ0Ao13CdiBTi7hlj22CnRSMUGmxO+hJN Z9SwgZuefMOd56A8SRCQU4FwNZ21VeYp63ZrRXc9nonxMBu9nG7JvrdaI3H6Twnp80 OVO2RC1yuAPDVzo0OXsqZlQ/r4UzMEwt3jDQeUea22bVMH0R60RlwkJGJWmdMn6dJW RfKvnqqXLMEX4WAEWFGCYGQWlgw2RrBf7PRJ8QzMdAzS+oDzc7Eo72fnUMkn9IKEja KVmUjR/SFtMjdhc4tft5ieBP9NH7NOwlCt0yjo8APA1CYUvIiQQWLjYwgeFvCvfUdW KebzE8FdrBbSQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1858F180078 for ; Tue, 16 Sep 2025 14:49:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,T_SPF_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (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 ; Tue, 16 Sep 2025 14:49:03 +0000 (UTC) Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-62f1eb1abb9so4671212a12.0 for ; Tue, 16 Sep 2025 07:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758034227; x=1758639027; 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=VR22F64PYgfo7OQrYB7DdDBaBDyjpJKIiaest5SC2Kw=; b=khd4rzsPzoYwsH1v4Pk5UrCVYXYY567XgecHzXipaJz7DtrZCkcEg/36DfTux4XXih ZHfE2esRop5HQ2Tx+Hu0T1lV3pXOyYp/oq5XISkF5EM65t1v7yEP5Vqb4fMHadFeiBQX W6R1gz8q5G2ceLXMaG30XWS5zbFKGPUBd5xf/evXJ1AXdmpl/I2x9Rfuk2i0plhRkzzc Ty5C+oPRH+YlKPpnaJAil0gjC7RtKSPI8ikYa8nEqX+UA/IlcmFyfUxZmJSm84VmStyq ojy8NSygaTb9m5JVjBBpaQTrzI2xn0xGbRHbJc2xNOyyQ1s+atTi09z9o2PbmRqiirYG JK9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758034227; x=1758639027; 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=VR22F64PYgfo7OQrYB7DdDBaBDyjpJKIiaest5SC2Kw=; b=i8vnykOb7dL+heedS7JeM4ycpdEkDKYxpiYCBjIyvPeXA1nJRDuBvLy/pI3Ovk8h1z GRWGo6Zkpy1Nf7ce+Vd/8XRwk53DmoZdgSDVih1Hrs2pj2IqN8uJnEyt+Et0CRW13icB hUTnQzGZxMksgXzVBF8hayqQ4mNLNEawqXgsoNqoH9FyV05NSIdmT+bhBUx12mnk8HNC +nYgdrSGWRWP5NzPkF8OMEmI4pQcpEHLw4iueABMH9BO/kVzN9bde+yptMa/17C8GFoW qzJA+h35W91GGSP5MWWYP5+v0grAqYI7LHX3j6RE0ry7uR2m9GPxIbUgok4tfe/YQCIW GmIg== X-Gm-Message-State: AOJu0YyDVb/Zqe62QStr1/iQKhawPIaC0cr1JEFW6vEm0B58ntq/nemu IzaEe6c5+VgQu4qricM6Z/uqdqZ10UMWdFPdoeND6+nOXtIYT9WuKgoFToW6Ipg5T5LeCPv05ec LF6j2NZuxzkInu9ccXvwmpmRd/cgsUM8= X-Gm-Gg: ASbGncsnXjLKmSp1kOGzxJuJo5F/BHhcqo2LsdO+cHpnLPJ4nsUpZWe4hvrAHstspb0 nj4tEB3uyt5A8i5V9XhO7yUyO7nXKOTNntzGwd56w4PNTlM3nbzNnzWnDc3WT+QCUdw83CAhiC1 UU/WW31UmybkB89msyDzlHJi5+L0dCCZsL69jaIWGwKRPDt9fdgKuJvCoNJzpjwQ1XIwgJa0dvz 0N8Hnd575xh7N6PSRcExx2UteZJhBb1SWJrwvZvWBDg9imoJw== X-Google-Smtp-Source: AGHT+IGOnR+H7dTnOfV+awEXGFM+cpffZ5BQZxoTWHf+q0ytZrmr/awqGUsqmYpoR5cW4Boq5fDIeYjyg+5jq+fnd/M= X-Received: by 2002:a05:6402:5294:b0:62f:16c9:c992 with SMTP id 4fb4d7f45d1cf-62f65f3186amr2665793a12.11.1758034226663; Tue, 16 Sep 2025 07:50:26 -0700 (PDT) Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 16 Sep 2025 16:50:14 +0200 X-Gm-Features: AS18NWC3GQWxHoBuravjxr6vZhmixvE8iOuGQQNfD2__K8DGSv6hiHbYw_dci98 Message-ID: Subject: Re: [PHP-DEV] [RFC] Add pack()/unpack() support for signed integers with specific endianness To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: PHP internals list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: alex.daubois+php@gmail.com (Alexandre Daubois) Hi, > > 1. Base Letters Already Taken > > The point of a modifier is to modify something. That means that there > needs to be a =E2=80=9Cbase letter=E2=80=9D. The same base letters are al= so =E2=80=9Ctaken=E2=80=9D in > Perl and have the same definition. > > > 2. Parser Architecture Limitations > > That sounds like a simple problem to solve. When reaching one of the > =E2=80=9Cbase letters=E2=80=9D in question, look at the next character. Indeed, it is just that I'm not sure that it is worth adding modifiers support to pack and unpack as with this addition, most (if not all) cases should be covered then. > This is simply false. v/n/V/N identically exist in Perl. J is not clear > to me, and P appears to be different (but I don't do enough Perl to say > for certain). Perl and PHP share common letters, you are right. But looking at the table of each language, there are many differences. However, I may reword it as I realized that the RFC states that differences appear with specific endianness letters (and you showed that it's not true). There are many differences when we're not talking about endian specific formats actually. =E2=80=94 Alexandre Daubois