Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113101 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 56670 invoked from network); 6 Feb 2021 15:03:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Feb 2021 15:03:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 03FCC1804DD for ; Sat, 6 Feb 2021 06:47:41 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from darkcity.gna.ch (darkcity.gna.ch [195.49.47.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 6 Feb 2021 06:47:40 -0800 (PST) Received: from wafer.home (unknown [IPv6:2a02:1205:5053:a220:54a6:6051:7c4d:40d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id 83099150ED08; Sat, 6 Feb 2021 15:47:37 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) In-Reply-To: Date: Sat, 6 Feb 2021 15:47:37 +0100 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <248543D8-4266-4495-9FC4-762A63625A93@cschneid.com> References: To: Benjamin Morel X-Mailer: Apple Mail (2.3654.60.0.2.21) Subject: Re: [PHP-DEV] [RFC] Warning for implicit float to int conversions From: cschneid@cschneid.com (Christian Schneider) Am 06.02.2021 um 01:17 schrieb Benjamin Morel = : > Could we at least fix the odd cases where the cast is definitely a = failure? > Like: >=20 > (int) 1e60; // 0 > (int) "foo"; // 0 Are you talking about the constant values 1e60 and "foo"? If not then = please don't add a warning (or worse). I'm sure there is a lot of code which takes user input and uses (int) = casts to ensure they are dealing with integers. There is also intval() as an alternative but my guess would be that real = world code uses 50% (int) and 50% intval() to do this. This would be a big BC break IMHO. - Chris