Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96594 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56178 invoked from network); 24 Oct 2016 13:54:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Oct 2016 13:54:43 -0000 Authentication-Results: pb1.pair.com header.from=anatol.php@belski.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=anatol.php@belski.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain belski.net from 85.214.73.107 cause and error) X-PHP-List-Original-Sender: anatol.php@belski.net X-Host-Fingerprint: 85.214.73.107 klapt.com Received: from [85.214.73.107] ([85.214.73.107:37795] helo=h1123647.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/4E-28528-0A21E085 for ; Mon, 24 Oct 2016 09:54:42 -0400 Received: by h1123647.serverkompetenz.net (Postfix, from userid 1006) id 3D419784A88; Mon, 24 Oct 2016 15:54:37 +0200 (CEST) Received: from w530phpdev (p57A87E2F.dip0.t-ipconnect.de [87.168.126.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by h1123647.serverkompetenz.net (Postfix) with ESMTPSA id 061A4784A85; Mon, 24 Oct 2016 15:54:34 +0200 (CEST) To: "'Marc Bennewitz'" , "'PHP Internals List'" References: In-Reply-To: Date: Mon, 24 Oct 2016 15:54:31 +0200 Message-ID: <018101d22dfe$27496430$75dc2c90$@belski.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQFXK6YRb1o84l10exhw/SZXSw6SFaGtos/w Content-Language: en-us Subject: RE: [PHP-DEV] strtod and NaN vs. zero From: anatol.php@belski.net ("Anatol Belski") Hi Marc, > -----Original Message----- > From: Marc Bennewitz [mailto:dev@mabe.berlin] > Sent: Sunday, October 23, 2016 12:56 PM > To: PHP Internals List > Subject: [PHP-DEV] strtod and NaN vs. zero >=20 > Hi internals, >=20 > On casting a non numeric value to a float in PHP the result will be = float(0). >=20 > In PHP-7.0 an exception was introduced that on casting a string = "/\s*NaN\s*/i" > will result in float(NaN). >=20 > https://3v4l.org/2Xakm >=20 It is a BC breaching bug and was fixed = https://bugs.php.net/bug.php?id=3D73329 . Cast of string to number is = always zero, a way to change it would cause another BC breach which IMHO = were not worthwhile. Regards Anatol