diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index b0f913aac3e09..76f9dd8810c74 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -146,7 +146,7 @@ _LT_AC_TRY_DLOPEN_SELF([ ]) dnl Checks for library functions. -AC_CHECK_FUNCS(getpid kill finite sigsetjmp) +AC_CHECK_FUNCS(getpid kill sigsetjmp) ZEND_CHECK_FLOAT_PRECISION diff --git a/build/php.m4 b/build/php.m4 index 6aaf739815de9..d181bbeeba1d1 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -870,7 +870,7 @@ AC_DEFUN([PHP_SELECT_SAPI],[ +--------------------------------------------------------------------+ | *** ATTENTION *** | | | -| You've configured multiple SAPIs to be build. You can build only | +| You've configured multiple SAPIs to be built. You can build only | | one SAPI module plus CGI, CLI and FPM binaries at the same time. | +--------------------------------------------------------------------+ ]) @@ -2218,8 +2218,8 @@ AC_DEFUN([PHP_DETECT_SUNCC],[ dnl dnl PHP_CRYPT_R_STYLE dnl -dnl Detect the style of crypt_r() is any is available see -dnl APR_CHECK_CRYPT_R_STYLE() for original version. +dnl Detect the style of crypt_r() if any is available. +dnl See APR_CHECK_CRYPT_R_STYLE() for original version. dnl AC_DEFUN([PHP_CRYPT_R_STYLE], [ diff --git a/configure.ac b/configure.ac index e830acfb25582..99e04e6c1d0be 100644 --- a/configure.ac +++ b/configure.ac @@ -43,8 +43,6 @@ AH_TOP([ #define ZEND_DLIMPORT ]) AH_BOTTOM([ -#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS - #include #ifdef HAVE_SYS_TYPES_H @@ -61,8 +59,6 @@ AH_BOTTOM([ #include -#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */ - #endif /* PHP_CONFIG_H */ ]) @@ -372,7 +368,6 @@ dnl ---------------------------------------------------------------------------- dnl QNX requires unix.h to allow functions in libunix to work properly. AC_CHECK_HEADERS([ \ -inttypes.h \ stdint.h \ dirent.h \ sys/param.h \ @@ -389,8 +384,6 @@ grp.h \ ieeefp.h \ langinfo.h \ malloc.h \ -monetary.h \ -netdb.h \ poll.h \ pty.h \ pwd.h \ @@ -398,7 +391,6 @@ resolv.h \ strings.h \ syslog.h \ sysexits.h \ -sys/auxv.h \ sys/ioctl.h \ sys/file.h \ sys/mman.h \ @@ -415,7 +407,6 @@ sys/sysexits.h \ sys/uio.h \ sys/wait.h \ sys/loadavg.h \ -termios.h \ unistd.h \ unix.h \ utime.h \ @@ -1272,28 +1263,14 @@ AC_SUBST(EXPANDED_LOCALSTATEDIR) AC_SUBST(EXPANDED_PHP_CONFIG_FILE_PATH) AC_SUBST(EXPANDED_PHP_CONFIG_FILE_SCAN_DIR) -if test -n "$php_ldflags_add_usr_lib"; then - PHP_RPATHS="$PHP_RPATHS /usr/lib" -fi - PHP_UTILIZE_RPATHS -if test -z "$php_ldflags_add_usr_lib"; then - PHP_REMOVE_USR_LIB(PHP_LDFLAGS) - PHP_REMOVE_USR_LIB(LDFLAGS) -fi +PHP_REMOVE_USR_LIB(PHP_LDFLAGS) +PHP_REMOVE_USR_LIB(LDFLAGS) EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS" EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS" -dnl SOURCE_DATE_EPOCH for reproducible builds -dnl https://reproducible-builds.org/specs/source-date-epoch/ -PHP_BUILD_DATE=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d 2>/dev/null` -if test $? -ne 0 ; then -PHP_BUILD_DATE=`date -u +%Y-%m-%d` -fi -AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date]) - UNAME=`uname -a | xargs` PHP_UNAME=${PHP_UNAME:-$UNAME} AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output]) @@ -1356,7 +1333,6 @@ PHP_SUBST(LIBTOOL) PHP_SUBST(LN_S) PHP_SUBST_OLD(NATIVE_RPATHS) PHP_SUBST_OLD(PEAR_INSTALLDIR) -PHP_SUBST(PHP_BUILD_DATE) PHP_SUBST_OLD(PHP_LDFLAGS) PHP_SUBST_OLD(PHP_LIBS) PHP_SUBST(OVERALL_TARGET) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 85ac0f0b3078d..6957e9e73a649 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -241,6 +241,7 @@ static void curl_free_obj(zend_object *object); static HashTable *curl_get_gc(zend_object *object, zval **table, int *n); static zend_function *curl_get_constructor(zend_object *object); static zend_object *curl_clone_obj(zend_object *object); +static int curl_cast_object(zend_object *obj, zval *result, int type); php_curl *init_curl_handle_into_zval(zval *curl); static inline int build_mime_structure_from_hash(php_curl *ch, zval *zpostfields); @@ -1204,6 +1205,7 @@ PHP_MINIT_FUNCTION(curl) curl_object_handlers.get_gc = curl_get_gc; curl_object_handlers.get_constructor = curl_get_constructor; curl_object_handlers.clone_obj = curl_clone_obj; + curl_object_handlers.cast_object = curl_cast_object; curl_multi_register_class(class_CurlMultiHandle_methods); curl_share_register_class(class_CurlShareHandle_methods); @@ -1303,6 +1305,18 @@ static HashTable *curl_get_gc(zend_object *object, zval **table, int *n) return zend_std_get_properties(object); } +static int curl_cast_object(zend_object *obj, zval *result, int type) +{ + if (type == IS_LONG) { + /* For better backward compatibility, make (int) $curl_handle return the object ID, + * similar to how it previously returned the resource ID. */ + ZVAL_LONG(result, obj->handle); + return SUCCESS; + } + + return zend_std_cast_object_tostring(obj, result, type); +} + /* {{{ PHP_MSHUTDOWN_FUNCTION */ PHP_MSHUTDOWN_FUNCTION(curl) diff --git a/ext/curl/tests/curl_int_cast.phpt b/ext/curl/tests/curl_int_cast.phpt new file mode 100644 index 0000000000000..3f31b24210611 --- /dev/null +++ b/ext/curl/tests/curl_int_cast.phpt @@ -0,0 +1,20 @@ +--TEST-- +Casting CurlHandle to int returns object ID +--FILE-- + +--EXPECT-- +int(1) +int(2) +int(2) diff --git a/ext/standard/string.c b/ext/standard/string.c index 8a8c889f08209..1178b08730bcd 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -25,9 +25,6 @@ #ifdef HAVE_LANGINFO_H # include #endif -#ifdef HAVE_MONETARY_H -# include -#endif /* * This define is here because some versions of libintl redefine setlocale