Bug #45712 [ReO->Csd]: $something == NaN returns true with 5.3, false with 5.2.*

From: Date: Sat, 15 Feb 2014 23:12:45 +0000
Subject: Bug #45712 [ReO->Csd]: $something == NaN returns true with 5.3, false with 5.2.*
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184309@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=45712&edit=1 ID: 45712 Updated by: nikic@php.net Reported by: for-bugs at hnw dot jp Summary: $something == NaN returns true with 5.3, false with 5.2.* -Status: Re-Opened +Status: Closed Type: Bug Package: Variables related Operating System: * PHP Version: 5.2CVS, 5.3CVS, 6CVS (2008-08-05) Assigned To: tony2001 Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2013-09-16 16:48:45] cmbecker69 at gmx dot de > Please explain. It seems there was a bug *before* PHP 5.4, because if $a === $b, then $a == $b by definition. ------------------------------------------------------------------------ [2011-05-26 07:59:24] philip@php.net Reopening because the associated test tests INF as well. However, this is about INF: // 5.3.7-dev (and all past PHP versions, afaict) $inf = pow(0,-2); var_dump($inf==$inf); var_dump($inf===$inf); // false true // 5.4.0-dev $inf = pow(0,-2); var_dump($inf==$inf); var_dump($inf===$inf); // true true Please explain. And @jwvdveer, it was indeed fixed (in 5.3) and made to return false. ------------------------------------------------------------------------ [2010-07-28 01:28:53] jwvdveer at gmail dot com Please, reopen this bug. It's not working in PHP 5.3.3 on Windows platform (released at 2010-07-21). The behaviour of a comparison to NAN is the same as noted here. It's not just a me too, but this thread shouln't have been closed. ------------------------------------------------------------------------ [2008-08-07 08:36:33] tony2001@php.net This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2008-08-07 07:37:04] tony2001@php.net I'm testing a patch for it. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=45712 -- Edit this bug report at https://bugs.php.net/bug.php?id=45712&edit=1

« previous php.bugs (#184309) next »