Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/Zend.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
+--------------------------------------------------------------------+
])
Expand Down Expand Up @@ -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],
[
Expand Down
28 changes: 2 additions & 26 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ AH_TOP([
#define ZEND_DLIMPORT
])
AH_BOTTOM([
#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS

#include <stdlib.h>

#ifdef HAVE_SYS_TYPES_H
Expand All @@ -61,8 +59,6 @@ AH_BOTTOM([

#include <string.h>

#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */

#endif /* PHP_CONFIG_H */
])

Expand Down Expand Up @@ -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 \
Expand All @@ -389,16 +384,13 @@ grp.h \
ieeefp.h \
langinfo.h \
malloc.h \
monetary.h \
netdb.h \
poll.h \
pty.h \
pwd.h \
resolv.h \
strings.h \
syslog.h \
sysexits.h \
sys/auxv.h \
sys/ioctl.h \
sys/file.h \
sys/mman.h \
Expand All @@ -415,7 +407,6 @@ sys/sysexits.h \
sys/uio.h \
sys/wait.h \
sys/loadavg.h \
termios.h \
unistd.h \
unix.h \
utime.h \
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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)
Expand Down
14 changes: 14 additions & 0 deletions ext/curl/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
20 changes: 20 additions & 0 deletions ext/curl/tests/curl_int_cast.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--TEST--
Casting CurlHandle to int returns object ID
--FILE--
<?php

$handle1 = curl_init();
var_dump((int) $handle1);
$handle2 = curl_init();
var_dump((int) $handle2);

// NB: Unlike resource IDs, object IDs are reused.
unset($handle2);
$handle3 = curl_init();
var_dump((int) $handle3);

?>
--EXPECT--
int(1)
int(2)
int(2)
3 changes: 0 additions & 3 deletions ext/standard/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
#ifdef HAVE_LANGINFO_H
# include <langinfo.h>
#endif
#ifdef HAVE_MONETARY_H
# include <monetary.h>
#endif

/*
* This define is here because some versions of libintl redefine setlocale
Expand Down