Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129091 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 574981A00BC for ; Wed, 5 Nov 2025 16:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762360451; bh=pW6GWsnvpFa2UtKxooZobWzT9AKx8S++idr8V9qHVRY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UM5JRCpHlVUZmDUwO6wIRqi7NX4GIlOeg2h5NeE3xoC1iI42SHE//9TVhZFsTOnz/ uY4AWKlg7sKAStYkskUfKhpK4ApgBzn7mpQHhE02GQLL5C1R5uI/fjd0wwcXWpyvtX +62kmsU3Hna8nxsemsysk4KWWXXMvLnAa7UtoIyO9hUC/OfNxGtY37xKVj4Mmk6yPP OGTLA1z86tL6nWST0LoiYzwH5eMgxekOdqQ/yvkGVsXenE0+/iK5nRE0HomZC8ppfi WZ6YqZJh2SJqresL4PCD2KInwCH5qEj8iAsF3f15W42qt0UzbP4q1+BUMSrfodjiNb ThS3ywIl6KH9Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5D9021801E1 for ; Wed, 5 Nov 2025 16:34:11 +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.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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 ; Wed, 5 Nov 2025 16:34:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1762360445; bh=Ry0YOklhP9PHgbhy//Id63O8TlTveRMpxrHtowLXm0s=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=XcBVifMwy4xV8Ufa9VAY4Q0hxKgLtb0B3Us38VuzXmJUDoxlS5P/6FHH5z+DebH5C RlzI9CbGIipq0+EJ/70Py411w1To5g7g7MqhyucTXKHVGh6N8BoDf5yjQm/pk0Hhii Q0ZpN9yAkgwJkKPhmndRh9m8EW7P9iA51pWl7mCsO8UQdih5YauYG/2SXkB0Hbmq7Q qI0EmpmRGcdGsF6dANx9aAGwH+o/2N9FKzsRYmKvUV+7nq76X2bs6MHnfZ/CQTsasP 9qR3yU1vI+pHyFsGiPc7YDylQB3bThcoLITWpIktBgE23FqwErR0nz8YcwZWQbWxDb 4W8VT5ZHTMung== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Wed, 05 Nov 2025 17:34:04 +0100 To: Alexandre Daubois Cc: Niels Dossche , internals@lists.php.net Subject: Re: [PHP-DEV] Re: [RFC] Add pack()/unpack() support for signed integers with specific endianness In-Reply-To: References: <86c27cd68c8ba8056d832a845eb15dcd@bastelstu.be> <4ecce462-6d20-4958-931d-b160e79752c4@app.fastmail.com> <3a833bdd-91d6-4af2-a465-c1ccc1653e22@gmail.com> Message-ID: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) 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 error Correct. 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