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

From: Date: Tue, 16 Sep 2025 14:50:14 +0000
Subject: Re: [RFC] Add pack()/unpack() support for signed integers with specific endianness
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-128707@lists.php.net to get a copy of this message
Hi, > > 1. Base Letters Already Taken > > The point of a modifier is to modify something. That means that there > needs to be a “base letter”. The same base letters are also “taken” in > Perl and have the same definition. > > > 2. Parser Architecture Limitations > > That sounds like a simple problem to solve. When reaching one of the > “base letters” 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. — Alexandre Daubois

« previous php.internals (#128707) next »