Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96557 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56907 invoked from network); 23 Oct 2016 11:50:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2016 11:50:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.220 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.220 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.220] ([81.169.146.220:10759] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/BE-28528-AE3AC085 for ; Sun, 23 Oct 2016 07:50:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1477223399; l=2165; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=5dZXupuHT749dI2hcv21LX1dKB0Rh/iv1jqkMqYU7UI=; b=RFt5w8OTRkqbD8k84FEj1QvOHG+/Y8d3VmhWfL2rkFgMjN1tV6dmUSqOAQ6Wc6nOj/K w5GtL+bPonoEXk8956g0JFceHQoY1aXdSICrvABvFn1hw7BoHJEbJhu3JyF6GYfecbTgL 69YS9NTJy/p2Y1mDXG8is2iirbd7Z84J9cE= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLGvomb4bl9EfHtO3A6 X-RZG-CLASS-ID: mo00 Received: from mail-wm0-f43.google.com ([74.125.82.43]) by smtp.strato.de (RZmta 39.6 AUTH) with ESMTPSA id 2032c0s9NBnxrLm (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp384r1 with 384 ECDH bits, eq. 7680 bits RSA)) (Client did not present a certificate) for ; Sun, 23 Oct 2016 13:49:59 +0200 (CEST) Received: by mail-wm0-f43.google.com with SMTP id b80so58176629wme.1 for ; Sun, 23 Oct 2016 04:49:59 -0700 (PDT) X-Gm-Message-State: AA6/9RnanyqDHeqV1MkxcyidSLiqeeOR19jUEP+Lv/89Q/W5oYutSehez1nagXtbIKOuhDqcEVknIakQoF6vLg== X-Received: by 10.28.138.209 with SMTP id m200mr17005300wmd.89.1477223399069; Sun, 23 Oct 2016 04:49:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.177.153 with HTTP; Sun, 23 Oct 2016 04:49:58 -0700 (PDT) In-Reply-To: References: Date: Sun, 23 Oct 2016 13:49:58 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Marc Bennewitz Cc: PHP Internals List Content-Type: multipart/alternative; boundary=001a114717faf4a62e053f86dff7 Subject: Re: [PHP-DEV] strtod and NaN vs. zero From: me@kelunik.com (Niklas Keller) --001a114717faf4a62e053f86dff7 Content-Type: text/plain; charset=UTF-8 2016-10-23 12:55 GMT+02:00 Marc Bennewitz : > Hi internals, > > On casting a non numeric value to a float in PHP the result will be > float(0). > > In PHP-7.0 an exception was introduced that on casting a string > "/\s*NaN\s*/i" will result in float(NaN). > > https://3v4l.org/2Xakm > > Wouldn't it be more logical and expected to return NaN in all cases of > casting a non numeric string to a floating point number? > > Thanks > Marc > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > +1 Regards, Niklas --001a114717faf4a62e053f86dff7--