Re: Re: [RFC] Add pack()/unpack() support for signed integers with specific endianness
| From: | Tim Düsterhus | Date: | Wed, 05 Nov 2025 16:34:04 +0000 |
| Subject: | Re: Re: [RFC] Add pack()/unpack() support for signed integers with specific endianness | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-129091@lists.php.net to get a copy of this message | ||
Hi
Am 2025-11-05 09:57, schrieb Alexandre Daubois:
So, if I get it right, you would both prefer a RFC proposing to add < and > for letters using machine endianness, with no effect on other letters (like Perl does)? I try to think about possible edge and errorCorrect. More specifically: The modifiers should emit an error for unsupported letters instead of silently failing. This is what my proof-of-concept patch already implements and it's in line with unknown letters throwing:
php > var_dump(pack('?', 123));
PHP Warning: Uncaught ValueError: Type ?: unknown format code in php shell code:1
Other than that, I can't think of any edge cases worth handling.
Best regards
Tim Düsterhus