Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128032 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 C47711A00BC for ; Mon, 14 Jul 2025 11:55:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1752494001; bh=fIOMyU0d2/t03aYZZLaz6+ptfj7Me+98bJ2A9rH+Q/o=; h=Date:To:From:Subject:From; b=ZGa74HRc8vdyS4N7wUgIKtpvV69fB/0ZaIaoVCdSf/UabR2J+J3rkbUqp0iuFZIOj Sbqu8TrpxecUFE6NTyOD76usmIaHw7O1SuTZLUcLOaHyV6PVIIgFCc8LZo4OtqToq0 M0Ri9RDdbUizQ9LBfBe5mnLQDa12D9q2Z4SM1Job8hlFWHn3BydBgI3xcmNpQJruKy LFS6x/fcUU/2uPX0niWLaeAMqDmjJIApzcpjJBQFvMKsNhYT9bOYDd3sKYYBRi9FxY Hi6o+h7sJFvz9TADtGKGRtJk99Ywmf1DWjXeY/8rbZoMiTnjDMCfHjaa64p3Yxmyb0 oVJil0dy67/fA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3F80B18005D for ; Mon, 14 Jul 2025 11:53:19 +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=-3.1 required=5.0 tests=BAYES_00,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: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-24422.protonmail.ch (mail-24422.protonmail.ch [109.224.244.22]) (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, 14 Jul 2025 11:53:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail; t=1752494104; x=1752753304; bh=fIOMyU0d2/t03aYZZLaz6+ptfj7Me+98bJ2A9rH+Q/o=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=txkTkWH/oj0Wib/F4blcqUZNle0/YFLku6dlloplrUBR1SuvhyFmQ/jEd6msTy73b 55f02riC8iCtmUzhBmT9pqgcvklIl6fJFKeFonDLc8JmqdCujT6wandoqGgt8GvhhR ExXgWA+QOY8ygRHxBCQaSHKEhugE4UqxX9f7VEwdDqD8g2WkoGjemZ5uQ5H+u8MoOs h0Ghl0Gp2GxFHXHdF/IUNiuQJkKfciRZDG48lfXglkD9uo6zhP0447VPBlF5vh2yjD 7W1SiU+iIjTjqNkLq8vmqBI/Ammxed5fj2BSq1zrLpz/pLWhalG/+grQr8X3dSAXMB qCSN0Bvj0lFFw== Date: Mon, 14 Jul 2025 11:54:57 +0000 To: PHP internals Subject: [PHP-DEV] Introduce PHP_INT_MAX_SAFE constant similar to JS's Number.MAX_SAFE_INTEGER constant Message-ID: Feedback-ID: 96993444:user:proton X-Pm-Message-ID: 5b222aace2e488f1bec7a7c846fa2f3dc51714c2 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net 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") Hello internals, I'm mailing the list for the bike shed of the naming of a new constant I th= ink we should introduce in PHP which I'm currently calling PHP_INT_MAX_SAFE= . The purpose of this integer is to indicate what is the maximal integer valu= e that can be correctly represented by a float. On 32 bits this is equal to PHP_INT_MAX, but on 64 bits it is 9007199254740= 991 (which is 2^(53) =E2=80=93 1) as the mantissa of a floating point numbe= r is 52 bits. For more information, please see the MDN documentation about Number.MAX_SAF= E_INTEGER. [1] The implementation is very simple and the PR is https://github.com/php/php-= src/pull/19126 Best regards, Gina P. Banyard [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Globa= l_Objects/Number/MAX_SAFE_INTEGER