Skip to content

Commit

Permalink
Merge branch 'PHP-7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
hikari-no-yume committed Feb 5, 2017
2 parents 2edc3cf + b87e399 commit 07d1cd3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Zend/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
#else
#define zend_isnan(a) 0
#define zend_isnan(a) ((a) != (a))
#endif
#endif
Expand Down
23 changes: 23 additions & 0 deletions Zend/tests/bug73954.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--TEST--
Bug #73954 (NAN check fails on Alpine Linux with musl)
--FILE--
<?php

var_dump(NAN);
var_dump(is_nan(NAN));

function takes_int(int $int) {
}

takes_int(NAN);

?>
--EXPECTF--
float(NAN)
bool(true)

Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type integer, float given, called in %s on line 9 and defined in %s:6
Stack trace:
#0 %s(9): takes_int(NAN)
#1 {main}
thrown in %s on line 6
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
#else
#define zend_isnan(a) 0
#define zend_isnan(a) ((a) != (a))
#endif
#endif
Expand Down

0 comments on commit 07d1cd3

Please sign in to comment.