Re: Re: [RFC] Add pack()/unpack() support for signed integers with specific endianness

From: Date: Mon, 24 Nov 2025 11:20:58 +0000
Subject: Re: Re: [RFC] Add pack()/unpack() support for signed integers with specific endianness
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-129426@lists.php.net to get a copy of this message
Hi Tim,

Le dim. 23 nov. 2025 à 15:45, Tim Düsterhus <tim@bastelstu.be> a écrit :
> > 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.

I agree. I just updated the text and tables to reflect the addition of
big and little endian unsigned integers throughout the document.

> There's also a formatting issue of the “Rationale” in the “Proposed
> Solution” section.

The text has been cleaned and simplified. Thanks!

— Alexandre Daubois


Thread (33 messages)

« previous php.internals (#129426) next »