diff --git a/ext/curl/config.w32 b/ext/curl/config.w32 index 253c3e3cb6356..db584c29e7ff4 100644 --- a/ext/curl/config.w32 +++ b/ext/curl/config.w32 @@ -8,8 +8,7 @@ if (PHP_CURL != "no") { SETUP_OPENSSL("curl", PHP_CURL) >= 2 && CHECK_LIB("winmm.lib", "curl", PHP_CURL) && CHECK_LIB("wldap32.lib", "curl", PHP_CURL) && - (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "curl", PHP_CURL))) || - (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "curl", PHP_CURL)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) && + SETUP_ZLIB_LIB("curl", PHP_CURL) && (CHECK_LIB("normaliz.lib", "curl", PHP_CURL) && CHECK_LIB("libssh2.lib", "curl", PHP_CURL) && CHECK_LIB("nghttp2.lib", "curl", PHP_CURL)) diff --git a/ext/gd/config.w32 b/ext/gd/config.w32 index 939755bf539d1..4e168fc3474f6 100644 --- a/ext/gd/config.w32 +++ b/ext/gd/config.w32 @@ -16,8 +16,8 @@ if (PHP_GD != "no") { CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng12")) && (CHECK_LIB("libiconv_a.lib;libiconv.lib", "gd", PHP_GD) || CHECK_LIB("iconv_a.lib;iconv.lib", "gd", PHP_GD)) && CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_GD", PHP_GD) && - (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "gd", PHP_GD) )) || - (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "gd", PHP_GD)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) + SETUP_ZLIB_LIB("gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects) ) { if (CHECK_LIB("libXpm_a.lib", "gd", PHP_GD) && diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 1d87695c6e335..a23263d407e6f 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -96,7 +96,7 @@ PHP_GMP_API zend_class_entry *php_gmp_class_entry(void) { ((__GNU_MP_VERSION >= 6) || (__GNU_MP_VERSION >= 5 && __GNU_MP_VERSION_MINOR >= 1)) #define IS_GMP(zval) \ - (Z_TYPE_P(zval) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zval), gmp_ce)) + (Z_TYPE_P(zval) == IS_OBJECT && Z_OBJCE_P(zval) == gmp_ce) #define GET_GMP_OBJECT_FROM_OBJ(obj) \ php_gmp_object_from_zend_object(obj) @@ -116,7 +116,7 @@ static bool gmp_zend_parse_arg_into_mpz_ex( bool is_operator ) { if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) { - if (EXPECTED(instanceof_function(Z_OBJCE_P(arg), gmp_ce))) { + if (EXPECTED(Z_OBJCE_P(arg) == gmp_ce)) { *destination_mpz_ptr = GET_GMP_FROM_ZVAL(arg); return true; } @@ -404,7 +404,7 @@ typeof_op_failure: ; static zend_result gmp_do_operation_ex(uint8_t opcode, zval *result, zval *op1, zval *op2) /* {{{ */ { - mpz_ptr gmp_op1, gmp_result; + mpz_ptr gmp_result; switch (opcode) { case ZEND_ADD: return binop_operator_helper(mpz_add, result, op1, op2); @@ -429,11 +429,9 @@ static zend_result gmp_do_operation_ex(uint8_t opcode, zval *result, zval *op1, case ZEND_BW_XOR: return binop_operator_helper(mpz_xor, result, op1, op2); case ZEND_BW_NOT: { - if (!gmp_zend_parse_arg_into_mpz_ex(op1, &gmp_op1, 1, false)) { - return FAILURE; - } + ZEND_ASSERT(Z_TYPE_P(op1) == IS_OBJECT && Z_OBJCE_P(op1) == gmp_ce); gmp_create(result, &gmp_result); - mpz_com(gmp_result, gmp_op1); + mpz_com(gmp_result, GET_GMP_FROM_ZVAL(op1)); return SUCCESS; } diff --git a/ext/gmp/tests/gmp_pow.phpt b/ext/gmp/tests/gmp_pow.phpt index 1d77bd5e96c80..f42e44e31abed 100644 --- a/ext/gmp/tests/gmp_pow.phpt +++ b/ext/gmp/tests/gmp_pow.phpt @@ -2,8 +2,6 @@ gmp_pow() basic tests --EXTENSIONS-- gmp ---SKIPIF-- - --FILE-- ---FILE-- -getMessage() . "\n"; -} -var_dump(gmp_strval(gmp_pow("-2",10))); -try { - gmp_pow(20,10); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; -} -try { - gmp_pow(50,10); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; -} -try { - gmp_pow(50,-5); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; -} -try { - $n = gmp_init("20"); - gmp_pow($n,10); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; -} -try { - $n = gmp_init("-20"); - gmp_pow($n,10); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; -} -try { - var_dump(gmp_pow(2,array())); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; -} - -try { - var_dump(gmp_pow(array(),10)); -} catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; -} - -echo "Done\n"; -?> ---EXPECT-- -string(4) "1024" -string(4) "1024" -string(5) "-2048" -string(4) "1024" -string(1) "1" -gmp_pow(): Argument #2 ($exponent) must be greater than or equal to 0 -string(4) "1024" -base and exponent overflow -base and exponent overflow -gmp_pow(): Argument #2 ($exponent) must be greater than or equal to 0 -base and exponent overflow -base and exponent overflow -gmp_pow(): Argument #2 ($exponent) must be of type int, array given -gmp_pow(): Argument #1 ($num) must be of type GMP|string|int, array given -Done diff --git a/ext/gmp/tests/gmp_pow_fpe.phpt b/ext/gmp/tests/gmp_pow_fpe.phpt deleted file mode 100644 index 248922e80514d..0000000000000 --- a/ext/gmp/tests/gmp_pow_fpe.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -gmp_pow() floating point exception ---EXTENSIONS-- -gmp ---FILE-- -getMessage() . PHP_EOL; -} -try { - gmp_pow(256, PHP_INT_MAX); -} catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; -} - -try { - gmp_pow(gmp_add(gmp_mul(gmp_init(PHP_INT_MAX), gmp_init(PHP_INT_MAX)), 3), 256); -} catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; -} -try { - gmp_pow(gmp_init(PHP_INT_MAX), 256); -} catch (\ValueError $e) { - echo $e->getMessage(); -} -?> ---EXPECTF-- -base and exponent overflow -base and exponent overflow -base and exponent overflow -base and exponent overflow diff --git a/ext/mysqlnd/config.w32 b/ext/mysqlnd/config.w32 index e9ff75f237ced..cf6bf4b61ccc1 100644 --- a/ext/mysqlnd/config.w32 +++ b/ext/mysqlnd/config.w32 @@ -28,12 +28,9 @@ if (PHP_MYSQLND != "no") { "mysqlnd_wireprotocol.c " + "php_mysqlnd.c "; EXTENSION("mysqlnd", mysqlnd_source, false, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); - if ((((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "mysqlnd", PHP_MYSQLND))) || - (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "mysqlnd", PHP_MYSQLND)) || - (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) && + if (SETUP_ZLIB_LIB("mysqlnd", PHP_MYSQLND) && CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects) - ) - { + ) { AC_DEFINE("MYSQLND_COMPRESSION_ENABLED", 1, "Define to 1 if mysqlnd has compressed protocol support."); AC_DEFINE("MYSQLND_SSL_SUPPORTED", 1, "Define to 1 if mysqlnd core SSL is enabled."); if (CHECK_LIB("crypt32.lib", "mysqlnd")) { diff --git a/ext/odbc/odbc.stub.php b/ext/odbc/odbc.stub.php index f1eb2a890b3c3..8a54e913e88ed 100644 --- a/ext/odbc/odbc.stub.php +++ b/ext/odbc/odbc.stub.php @@ -351,18 +351,15 @@ function odbc_exec(Odbc\Connection $odbc, string $query): Odbc\Result|false {} function odbc_do(Odbc\Connection $odbc, string $query): Odbc\Result|false {} #ifdef PHP_ODBC_HAVE_FETCH_HASH - /** @param resource $statement */ - function odbc_fetch_object($statement, ?int $row = null): stdClass|false {} + function odbc_fetch_object(Odbc\Result $statement, ?int $row = null): stdClass|false {} - /** @param resource $statement */ - function odbc_fetch_array($statement, ?int $row = null): array|false {} + function odbc_fetch_array(Odbc\Result $statement, ?int $row = null): array|false {} #endif /** - * @param resource $statement * @param array $array */ - function odbc_fetch_into($statement, &$array, ?int $row = null): int|false {} + function odbc_fetch_into(Odbc\Result $statement, &$array, ?int $row = null): int|false {} function odbc_fetch_row(Odbc\Result $statement, ?int $row = null): bool {} diff --git a/ext/odbc/odbc_arginfo.h b/ext/odbc/odbc_arginfo.h index d586f5a948edc..91df4da846d49 100644 --- a/ext/odbc/odbc_arginfo.h +++ b/ext/odbc/odbc_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 30ed66d5e97f6615a461d39f40f85a18ba618711 */ + * Stub hash: efd913e4fcacb2949dc5392857032ab9c59c818d */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_odbc_close_all, 0, 0, IS_VOID, 0) ZEND_END_ARG_INFO() @@ -41,18 +41,18 @@ ZEND_END_ARG_INFO() #if defined(PHP_ODBC_HAVE_FETCH_HASH) ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_odbc_fetch_object, 0, 1, stdClass, MAY_BE_FALSE) - ZEND_ARG_INFO(0, statement) + ZEND_ARG_OBJ_INFO(0, statement, Odbc\\Result, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, row, IS_LONG, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_odbc_fetch_array, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_INFO(0, statement) + ZEND_ARG_OBJ_INFO(0, statement, Odbc\\Result, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, row, IS_LONG, 1, "null") ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_odbc_fetch_into, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_INFO(0, statement) + ZEND_ARG_OBJ_INFO(0, statement, Odbc\\Result, 0) ZEND_ARG_INFO(1, array) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, row, IS_LONG, 1, "null") ZEND_END_ARG_INFO() diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 3623dcf7e25e1..e847417bc77b0 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3626,6 +3626,11 @@ function ADD_MAKEFILE_FRAGMENT(src_file) } } +function SETUP_ZLIB_LIB(target, path_to_check) +{ + return (PHP_ZLIB != "no" && !PHP_ZLIB_SHARED) || CHECK_LIB("zlib_a.lib;zlib.lib", target, path_to_check); +} + function SETUP_OPENSSL(target, path_to_check, common_name, use_env, add_dir_part, add_to_flag_only) { var ret = 0;