Skip to content

Commit

Permalink
Merge branch 'PHP-7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Feb 7, 2017
2 parents ed4216c + bb9adc4 commit 1b40313
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Zend/Zend.m4
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ AC_FUNC_ALLOCA
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp)
AC_ZEND_BROKEN_SPRINTF
AC_CHECK_FUNCS(finite isfinite isinf isnan)
AC_CHECK_DECLS([isfinite, isnan, isinf], [], [], [[#include <math.h>]])
ZEND_FP_EXCEPT
Expand Down
8 changes: 4 additions & 4 deletions Zend/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#include <math.h>
#ifndef zend_isnan
#ifdef HAVE_ISNAN
#ifdef HAVE_DECL_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
Expand All @@ -72,18 +72,18 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif
#endif
#ifdef HAVE_ISINF
#ifdef HAVE_DECL_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
#define zend_isinf(a) (((a)==INFINITY)?1:0)
#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
#else
#define zend_isinf(a) 0
#endif
#if defined(HAVE_ISFINITE) || defined(isfinite)
#if defined(HAVE_DECL_ISFINITE)
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
Expand Down
8 changes: 4 additions & 4 deletions 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, ...);
#include <math.h>
#ifndef zend_isnan
#ifdef HAVE_ISNAN
#ifdef HAVE_DECL_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
Expand All @@ -77,18 +77,18 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif
#endif
#ifdef HAVE_ISINF
#ifdef HAVE_DECL_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
#define zend_isinf(a) (((a)==INFINITY)?1:0)
#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
#else
#define zend_isinf(a) 0
#endif
#if defined(HAVE_ISFINITE) || defined(isfinite)
#if defined(HAVE_DECL_ISFINITE)
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ dnl Check for available functions
dnl
dnl log2 could be used to improve the log function, however it requires C99. The check for log2 should be turned on,
dnl as soon as we support C99.
AC_CHECK_FUNCS(getcwd getwd asinh acosh atanh log1p hypot glob strfmon nice fpclass isinf isnan mempcpy strpncpy)
AC_CHECK_FUNCS(getcwd getwd asinh acosh atanh log1p hypot glob strfmon nice fpclass mempcpy strpncpy)
AC_FUNC_FNMATCH

dnl
Expand Down
28 changes: 28 additions & 0 deletions ext/standard/tests/math/bug74039.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--TEST--
Bug #74039: is_infinite(-INF) returns false
--FILE--
<?php

var_dump(is_finite(INF));
var_dump(is_infinite(INF));
var_dump(is_nan(INF));

var_dump(is_finite(-INF));
var_dump(is_infinite(-INF));
var_dump(is_nan(-INF));

var_dump(is_finite(NAN));
var_dump(is_infinite(NAN));
var_dump(is_nan(NAN));

?>
--EXPECT--
bool(false)
bool(true)
bool(false)
bool(false)
bool(true)
bool(false)
bool(false)
bool(false)
bool(true)

0 comments on commit 1b40313

Please sign in to comment.