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

From: Date: Mon, 03 Nov 2025 17:50:15 +0000
Subject: Re: Re: [RFC] Add pack()/unpack() support for signed integers with specific endianness
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-129057@lists.php.net to get a copy of this message
On 03/11/2025 18:33, Rob Landers wrote: > Please don’t do this. > > For those of us using pack()/unpack(), I don’t really care how much like or unlike Perl it > is, and having to switch strings based on php version because someone wanted it like Perl sounds > like a special kind of hell. It’s already tricky enough to get pack/unpack right when dealing with > binary data and having to do it twice plus maintain two different versions of the same string… no > thank you. AFAIU the old way of doing things won't break with Tim's suggestion. So there's no need to switch strings. It just adds the possibility of using <>. I agree it's already tricky enough to get things right, which is _exactly_ why Tim's approach is the right one. Instead of adding more arbitrarily chosen letters we now have a more meaningful way to indicate endianness. It also is proven by Tim's patch that this isn't hard to achieve. While implementation-wise adding some more letters is easier, Tim's patch isn't really difficult anyway. I will vote against the RFC in its current form in favor of Tim's approach. Kind regards Niels

« previous php.internals (#129057) next »