Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129405 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 A24F81A00C1 for ; Sun, 23 Nov 2025 14:45:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763909129; bh=VdL+nwsY5SuhFL30RZyjXBalnor16WOyBohzcmkIPHo=; h=Date:Subject:To:References:From:In-Reply-To:From; b=GzLKsaWlt1P/uHAjmDv4Yi9g/Jq2K2xkR7021ylvlexpkbnZ3sicxTH2iGMzTydtK FmhVwxI8jzBrp6YY+StWcV95MDgHI00Ok7jp+wrB7AT6Ewt8a9HwtSvSpPHURQ8qA6 F7UIeuU3blnTz7ZGY+4PiMwtQaqN4JNQG2Ktxd5AQmM+ThSZLPnfRfQy/bMIcH+0wZ mquxHmYde/i4RoNtVSWeovQQyk1qzQDHJNaBCzI1ENTq40HG41vDqVDKHwdbboFffJ sEv0cSuNqGMEeXsn4oLDr49N/8oZmiS5N+vwdJ4bHXogQBj34+qjRpn81XY1YU4PI/ gOFPiYrqk0H9A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8E29C180083 for ; Sun, 23 Nov 2025 14:45:28 +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_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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 ; Sun, 23 Nov 2025 14:45:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1763909121; bh=AXAcaQH8bni64yOqUCs72Ox2XvRuyK5cQKbUSRHi848=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=iPRjhx3mNok0DRxERE0teILoNHmwVXA9ZWHwZIyAviqWwHwo7iEmbAAQQWp/TF8yW HjWcTnpLM40hYfVsCiBCfFUEQfME7eosvvfgbPX31sJyhe9L54wHViZNBvbKPfjo7r HaOf7s39PIDrsxEkLtc+uXQC1Isw7uovAe/cFl5Pr+6SanRRzGA4mRPq0Iq8bJKYyd g1FpX8EtmGwbeAhf7AXTu+lp5T/6pAZ97zz8t4Afhac7QhcScYKf3tXEGxk8NEs27B TlDt99KvOV9zd/vONvK9hdqW3PZSNLm6sCm+ClU61jTzXNddiRHk3jjfPnDkdfZ90A W0dU9saU6ixjQ== Message-ID: <9b6665e9-7daa-4138-9e4d-180425cc7c8c@bastelstu.be> Date: Sun, 23 Nov 2025 15:45:19 +0100 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] Re: [RFC] Add pack()/unpack() support for signed integers with specific endianness To: Alexandre Daubois , PHP internals list References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 11/21/25 11:46, Alexandre Daubois wrote: > After rereading the threads and spending some time thinking about it > all, I propose a new version of this RFC aimed at adding Perl > modifiers. Indeed, this seems to be a better solution than the one > previously proposed, and several people seem to share this opinion. > > The RFC URL is the same and its version has been bumped to 1.1: > https://wiki.php.net/rfc/pack-unpack-endianness-signed-integers-support > > Looking forward to reading your feedback on this revision. Thank you. I only have one comment on > Initially, endianness modifiers will only be supported for signed integer format codes (s, l, q) since unsigned integers already have dedicated endian-specific letters. While there are already dedicated alternatives, I feel that restricting the new modifiers to the lowercase versions would be unnecessarily restrictive. Since the RFC argues that: > 2. Intuitive semantics: The < and > symbols visually suggest byte order direction which I agree with, the same argument applies to the uppercase QLS versions. As a developer I would rather remember l> as "signed long big-endian" and L> as "unsigned long big-endian" rather than N as "4-byte network-byte order". Since there is no inherent limitation or ambiguity with supporting modifiers on QLS, I would suggest just allowing it. In fact I think my PoC patch already supported them. There's also a formatting issue of the “Rationale” in the “Proposed Solution” section. Best regards Tim Düsterhus