Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129053 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 BD6921A00BC for ; Mon, 3 Nov 2025 14:51:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762181497; bh=130+znUfk+ZTYP1drYO5BUhzVkJyZSTXT3szHaTVorU=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=J4L4HYimvms8dYNajSEQGjS6fusciKR8a6s/gpFkrEea5WZpRw75O+T0a/hvMYMQy ziq4E6w6FHudlfA2gkoj8Rtdm+ZgPCnj5JHiFPpYjmUU33K0VIZ5bLBnnceRrxwPBt Y1hntl+1ZbWqdOf/DkjgHuMFeSxqxTePzrs8Xlj+j0EO/YmaQ+9LXogmB1G72qot7q cyC8xZKx4hISAFXjGILCDAPC6orAoOID9LQz3CJrUqPh9d0Nah27NLl6Dqe/3UEg+j 3eT0mBswSlXKogh8Q3Nn4632vdcCn8jq4L8CHk57NFt0/Uk5fVTPINX2DZugBZWcfV rV2yDhVsYmegQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7DC1618002E for ; Mon, 3 Nov 2025 14:51:35 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-10624.protonmail.ch (mail-10624.protonmail.ch [79.135.106.24]) (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 ; Mon, 3 Nov 2025 14:51:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail; t=1762181487; x=1762440687; bh=130+znUfk+ZTYP1drYO5BUhzVkJyZSTXT3szHaTVorU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=BJNcWBrCmJeug2qHCA1Tu2Ee+tvDAAlMsrrPm6MKBXYcEkDdxhxJiajZAcSLQJ3T5 IbOYYGGqXxmTeV5Rcm0lMuL0tgksApSLo8CHf1xPS0ud0rEMkvVwEHlg4JUvwzfl4v q41y8JqjC923nhzxgVGvMg9c6S/VrPJcBccoU76JUyleJTeIoPe9oLLuqnX9yOKwtf MIOzMvku0AFDM/fDCowh9jXaJvsD/fEKf/acZz7iz+lqcJDe086viEZafQD0wQt4vH JzPNRbIC+otEWJzGkzQvuyDkdA70992aWij54+4MbIHDSgs0NbHKxLYPyx29KhZush St9MotZrnX6qw== Date: Mon, 03 Nov 2025 14:51:23 +0000 To: =?utf-8?Q?Tim_D=C3=BCsterhus?= Cc: Alexandre Daubois , PHP internals list Subject: Re: [PHP-DEV] Re: [RFC] Add pack()/unpack() support for signed integers with specific endianness Message-ID: In-Reply-To: <86c27cd68c8ba8056d832a845eb15dcd@bastelstu.be> References: <86c27cd68c8ba8056d832a845eb15dcd@bastelstu.be> Feedback-ID: 96993444:user:proton X-Pm-Message-ID: fe9a12add9903cd977290f0792eaba4149a575ed Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: internals@gpb.moe ("Gina P. Banyard") On Friday, 31 October 2025 at 11:11, Tim D=C3=BCsterhus = wrote: > Hi >=20 > Am 2025-10-31 10:29, schrieb Alexandre Daubois: >=20 > > If no concerns are raised in the next few days, I'll open this RFC to > > the vote in its current state. >=20 >=20 > I will vote against the RFC in its current state for the reasons that I > outlined before. >=20 > It's needlessly diverging from Perl by inventing new letters that are > not even internally consistent with the existing letters (lowercase vs > uppercase is 16 bit vs 32 bit, not LE vs BE). It is also still making > the false statement that Perl's approach doesn't work for PHP when we > established during the discussion that it does work, if we want it to > work. It's also needlessly confusing the reader by including information > about a PR #19368 implementation that can easily be mistaken for > something that is already an established fact rather than a proposal. >=20 > Best regards > Tim D=C3=BCsterhus We do use lowercase/uppercase as an indicator for BE/LE for float specifier= s, something Perl does not support. However, the h (and b in Perl) specifiers use the case to indicate if it is= the low or high nibble first. Moreover, Perl and PHP primarily use cases to distinguish between signed an= d unsigned for integer specifiers, namely the s, l, q, i (and j for Perl) s= pecifiers. Only the n and v specifiers use uppercase to mean 32 bit instead of 16. So there isn't a true "meaning" behind what upper and lowercase means, be t= hat in Perl or in PHP. While the < > syntax to "force" the endianess of a sequence specifier is ni= ce. But if this requires rewriting the whole parser as this RFC implies, then y= ou are asking someone to commit to a larger amount of work than they signed= up, which is considered bad RFC etiquette. [1] Still stating your reason for rejecting an RFC is a nice heads up. The strongest argument for introducing the < and > specifiers is that Pytho= n [2] does it that way, but a key distinction is that it is the *only* way = to specify endianess. And if this would be a new parser/API we might as well do other changes suc= h as using a + or - specifier to indicate signedness, and add grouping usin= g () like Perl. Overall I am +-0 on this RFC because I don't use those functions, so I'll a= bstain from it. Best regards, Gina P. Banyard [1] https://github.com/Danack/RfcCodex/blob/master/etiquette/rfc_etiquette.= md#dont-volunteer-other-people-for-huge-amounts-of-work [2] https://docs.python.org/3/library/struct.html#struct-alignment