Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127476 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 24FE11A00BC for ; Tue, 27 May 2025 07:42:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748331635; bh=ryYM6N/FQNBpc7fHuE15zX+RHkWehLw7h1lVBXcmKPc=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Ma25Bg/E68u2D6D8tNGU/4FDFeOlX33hXFLZH3eJRUClX65WrB8riIFV/OSkqOwtg 3EOLr8Anz6yjRCiHgH5ldz270Kym3Vqaj7uYJA8ftl3k4TjBxC9IeX93oGI6FmO2Fr qif240YCWowlnyU7BDzGXeeIZk/tafaMikpcWVJrio2Zf7kWiXXQVa+Zdpp8mbeYbd Z/4PWoVfgfC0KfNQb0A4+cA1Fsx7TVIsmUyRr2sL7zZO0TNzXaKYUOkbcQZ9LIbl9x X9WsZ18jfnCWo9/B1JMHjd61Bma8dTTEUXWQJ8uJrUmjEDEuf1jHbrTe4tfTW6A7CN 6oeE90mpDucBA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8EF7F180068 for ; Tue, 27 May 2025 07:40:33 +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.1 required=5.0 tests=BAYES_50,DMARC_MISSING, HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from apynys.serveriai.lt (apynys.serveriai.lt [79.98.29.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 27 May 2025 07:40:33 +0000 (UTC) Received: from [90.138.64.13] (helo=[192.168.1.156]) by apynys.serveriai.lt with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.97.1) (envelope-from ) id 1uJoxK-0000000050L-1a5B; Tue, 27 May 2025 10:42:38 +0300 Content-Type: multipart/alternative; boundary="------------q8Ys2I2EpjxxS7Is8vEzHQDI" Message-ID: Date: Tue, 27 May 2025 10:42:38 +0300 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PHP-DEV] [RFC] Add preserve_key_types to array_keys() to prevent unintended int conversion To: =?UTF-8?B?6ams5q2j5by6?= , internals@lists.php.net References: Content-Language: en-US In-Reply-To: X-Sender: webmaster@daikaras.lt From: webmaster@daikaras.lt (Daikaras) This is a multi-part message in MIME format. --------------q8Ys2I2EpjxxS7Is8vEzHQDI Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit As Kamil mentioned, this is not limited to a single function but to array type as a whole. See previous discussion https://externals.io/message/116735. On 5/24/2025 6:43 PM, 马正强 wrote: > > I propose adding a |preserve_key_types| parameter to |array_keys()| to > address issues caused by automatic conversion of string-numeric keys > to integers. > --------------q8Ys2I2EpjxxS7Is8vEzHQDI Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
As Kamil mentioned, this is not limited to a single function but to array type as a whole. See previous discussion https://externals.io/message/116735.

On 5/24/2025 6:43 PM, 马正强 wrote:

I propose adding a preserve_key_types parameter to array_keys() to address issues caused by automatic conversion of string-numeric keys to integers.


--------------q8Ys2I2EpjxxS7Is8vEzHQDI--