diff --git a/Zend/tests/bug67368.phpt b/Zend/tests/bug67368.phpt index f588270f5984c..50ca00d36d406 100644 --- a/Zend/tests/bug67368.phpt +++ b/Zend/tests/bug67368.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #67368 (Memory leak with immediately dereferenced array in class constant) ---INI-- -report_memleaks=1 --FILE-- #include +extern "C" { #include "php_intl.h" #include "msgformat_class.h" #include "msgformat_data.h" #include "intl_convert.h" +} /* {{{ */ static int msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) @@ -99,7 +101,7 @@ static int msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) /* }}} */ /* {{{ Create formatter. */ -PHP_FUNCTION( msgfmt_create ) +U_CFUNC PHP_FUNCTION( msgfmt_create ) { object_init_ex( return_value, MessageFormatter_ce_ptr ); if (msgfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU) == FAILURE) { @@ -110,7 +112,7 @@ PHP_FUNCTION( msgfmt_create ) /* }}} */ /* {{{ MessageFormatter object constructor. */ -PHP_METHOD( MessageFormatter, __construct ) +U_CFUNC PHP_METHOD( MessageFormatter, __construct ) { const bool old_use_exception = INTL_G(use_exceptions); const zend_long old_error_level = INTL_G(error_level); @@ -127,7 +129,7 @@ PHP_METHOD( MessageFormatter, __construct ) /* }}} */ /* {{{ Get formatter's last error code. */ -PHP_FUNCTION( msgfmt_get_error_code ) +U_CFUNC PHP_FUNCTION( msgfmt_get_error_code ) { zval* object = NULL; MessageFormatter_object* mfo = NULL; @@ -147,7 +149,7 @@ PHP_FUNCTION( msgfmt_get_error_code ) /* }}} */ /* {{{ Get text description for formatter's last error code. */ -PHP_FUNCTION( msgfmt_get_error_message ) +U_CFUNC PHP_FUNCTION( msgfmt_get_error_message ) { zend_string* message = NULL; zval* object = NULL; diff --git a/ext/intl/msgformat/msgformat_attr.c b/ext/intl/msgformat/msgformat_attr.cpp similarity index 96% rename from ext/intl/msgformat/msgformat_attr.c rename to ext/intl/msgformat/msgformat_attr.cpp index 6d1813f4608f8..e7ec006e5e793 100644 --- a/ext/intl/msgformat/msgformat_attr.c +++ b/ext/intl/msgformat/msgformat_attr.cpp @@ -16,15 +16,17 @@ #include #endif +extern "C" { #include "php_intl.h" #include "msgformat_class.h" #include "msgformat_data.h" #include "intl_convert.h" +} #include /* {{{ Get formatter pattern. */ -PHP_FUNCTION( msgfmt_get_pattern ) +U_CFUNC PHP_FUNCTION( msgfmt_get_pattern ) { MSG_FORMAT_METHOD_INIT_VARS; @@ -46,7 +48,7 @@ PHP_FUNCTION( msgfmt_get_pattern ) /* }}} */ /* {{{ Set formatter pattern. */ -PHP_FUNCTION( msgfmt_set_pattern ) +U_CFUNC PHP_FUNCTION( msgfmt_set_pattern ) { char* value = NULL; size_t value_len = 0; @@ -105,7 +107,7 @@ PHP_FUNCTION( msgfmt_set_pattern ) /* }}} */ /* {{{ Get formatter locale. */ -PHP_FUNCTION( msgfmt_get_locale ) +U_CFUNC PHP_FUNCTION( msgfmt_get_locale ) { char *loc; MSG_FORMAT_METHOD_INIT_VARS; diff --git a/ext/intl/msgformat/msgformat_class.c b/ext/intl/msgformat/msgformat_class.cpp similarity index 87% rename from ext/intl/msgformat/msgformat_class.c rename to ext/intl/msgformat/msgformat_class.cpp index 4e0766a911b9a..e762febf0d1b3 100644 --- a/ext/intl/msgformat/msgformat_class.c +++ b/ext/intl/msgformat/msgformat_class.cpp @@ -14,10 +14,12 @@ #include +extern "C" { #include "msgformat_class.h" #include "php_intl.h" #include "msgformat_data.h" #include "msgformat_arginfo.h" +} #include @@ -29,7 +31,7 @@ static zend_object_handlers MessageFormatter_handlers; */ /* {{{ MessageFormatter_objects_free */ -void MessageFormatter_object_free( zend_object *object ) +U_CFUNC void MessageFormatter_object_free( zend_object *object ) { MessageFormatter_object* mfo = php_intl_messageformatter_fetch_object(object); @@ -40,11 +42,11 @@ void MessageFormatter_object_free( zend_object *object ) /* }}} */ /* {{{ MessageFormatter_object_create */ -zend_object *MessageFormatter_object_create(zend_class_entry *ce) +U_CFUNC zend_object *MessageFormatter_object_create(zend_class_entry *ce) { MessageFormatter_object* intern; - intern = zend_object_alloc(sizeof(MessageFormatter_object), ce); + intern = reinterpret_cast(zend_object_alloc(sizeof(MessageFormatter_object), ce)); msgformat_data_init( &intern->mf_data ); zend_object_std_init( &intern->zo, ce ); object_properties_init(&intern->zo, ce); @@ -54,7 +56,7 @@ zend_object *MessageFormatter_object_create(zend_class_entry *ce) /* }}} */ /* {{{ MessageFormatter_object_clone */ -zend_object *MessageFormatter_object_clone(zend_object *object) +U_CFUNC zend_object *MessageFormatter_object_clone(zend_object *object) { MessageFormatter_object *mfo = php_intl_messageformatter_fetch_object(object); zend_object *new_obj = MessageFormatter_ce_ptr->create_object(object->ce); @@ -66,7 +68,7 @@ zend_object *MessageFormatter_object_clone(zend_object *object) /* clone formatter object */ if (MSG_FORMAT_OBJECT(mfo) != NULL) { UErrorCode error = U_ZERO_ERROR; - MSG_FORMAT_OBJECT(new_mfo) = umsg_clone(MSG_FORMAT_OBJECT(mfo), &error); + MSG_FORMAT_OBJECT(new_mfo) = reinterpret_cast(umsg_clone(MSG_FORMAT_OBJECT(mfo), &error)); if (U_FAILURE(error)) { zend_throw_error(NULL, "Failed to clone MessageFormatter"); diff --git a/ext/intl/msgformat/msgformat_data.c b/ext/intl/msgformat/msgformat_data.cpp similarity index 92% rename from ext/intl/msgformat/msgformat_data.c rename to ext/intl/msgformat/msgformat_data.cpp index 5d170d25945fa..f8b7ec39601eb 100644 --- a/ext/intl/msgformat/msgformat_data.c +++ b/ext/intl/msgformat/msgformat_data.cpp @@ -24,7 +24,7 @@ /* {{{ void msgformat_data_init( msgformat_data* mf_data ) * Initialize internals of msgformat_data. */ -void msgformat_data_init( msgformat_data* mf_data ) +U_CFUNC void msgformat_data_init( msgformat_data* mf_data ) { if( !mf_data ) return; @@ -40,7 +40,7 @@ void msgformat_data_init( msgformat_data* mf_data ) /* {{{ void msgformat_data_free( msgformat_data* mf_data ) * Clean up memory allocated for msgformat_data */ -void msgformat_data_free(msgformat_data* mf_data) +U_CFUNC void msgformat_data_free(msgformat_data* mf_data) { if (!mf_data) return; @@ -69,7 +69,7 @@ void msgformat_data_free(msgformat_data* mf_data) */ msgformat_data* msgformat_data_create( void ) { - msgformat_data* mf_data = ecalloc( 1, sizeof(msgformat_data) ); + msgformat_data* mf_data = reinterpret_cast(ecalloc( 1, sizeof(msgformat_data) )); msgformat_data_init( mf_data ); diff --git a/ext/intl/msgformat/msgformat_data.h b/ext/intl/msgformat/msgformat_data.h index 539c7d6d92557..bac94cbec34c3 100644 --- a/ext/intl/msgformat/msgformat_data.h +++ b/ext/intl/msgformat/msgformat_data.h @@ -17,7 +17,13 @@ #include +#ifdef __cplusplus +extern "C" { +#endif #include "../intl_error.h" +#ifdef __cplusplus +} +#endif #include @@ -26,16 +32,22 @@ typedef struct { intl_error error; // formatter handling - UMessageFormat* umsgf; + UMessageFormat *umsgf; char* orig_format; zend_ulong orig_format_len; HashTable* arg_types; int tz_set; /* if we've already the time zone in sub-formats */ } msgformat_data; +#ifdef __cplusplus +extern "C" { +#endif msgformat_data* msgformat_data_create( void ); void msgformat_data_init( msgformat_data* mf_data ); void msgformat_data_free( msgformat_data* mf_data ); +#ifdef __cplusplus +} +#endif #ifdef MSG_FORMAT_QUOTE_APOS int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec); diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.cpp similarity index 97% rename from ext/intl/msgformat/msgformat_format.c rename to ext/intl/msgformat/msgformat_format.cpp index 54babc9839648..8e3ec28b389e1 100644 --- a/ext/intl/msgformat/msgformat_format.c +++ b/ext/intl/msgformat/msgformat_format.cpp @@ -18,11 +18,13 @@ #include +extern "C" { #include "php_intl.h" #include "msgformat_class.h" #include "msgformat_data.h" #include "msgformat_helpers.h" #include "intl_convert.h" +} #ifndef Z_ADDREF_P #define Z_ADDREF_P(z) ((z)->refcount++) @@ -48,7 +50,7 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret /* }}} */ /* {{{ Format a message. */ -PHP_FUNCTION( msgfmt_format ) +U_CFUNC PHP_FUNCTION( msgfmt_format ) { zval *args; MSG_FORMAT_METHOD_INIT_VARS; @@ -69,7 +71,7 @@ PHP_FUNCTION( msgfmt_format ) /* }}} */ /* {{{ Format a message. */ -PHP_FUNCTION( msgfmt_format_message ) +U_CFUNC PHP_FUNCTION( msgfmt_format_message ) { zval *args; UChar *spattern = NULL; diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.cpp similarity index 97% rename from ext/intl/msgformat/msgformat_parse.c rename to ext/intl/msgformat/msgformat_parse.cpp index 5c4f0443981f4..28d7ce7108021 100644 --- a/ext/intl/msgformat/msgformat_parse.c +++ b/ext/intl/msgformat/msgformat_parse.cpp @@ -18,11 +18,13 @@ #include +extern "C" { #include "php_intl.h" #include "msgformat_class.h" #include "msgformat_data.h" #include "msgformat_helpers.h" #include "intl_convert.h" +} /* {{{ */ static void msgfmt_do_parse(MessageFormatter_object *mfo, char *source, size_t src_len, zval *return_value) @@ -52,7 +54,7 @@ static void msgfmt_do_parse(MessageFormatter_object *mfo, char *source, size_t s /* }}} */ /* {{{ Parse a message */ -PHP_FUNCTION( msgfmt_parse ) +U_CFUNC PHP_FUNCTION( msgfmt_parse ) { char *source; size_t source_len; @@ -74,7 +76,7 @@ PHP_FUNCTION( msgfmt_parse ) /* }}} */ /* {{{ Parse a message. */ -PHP_FUNCTION( msgfmt_parse_message ) +U_CFUNC PHP_FUNCTION( msgfmt_parse_message ) { UChar *spattern = NULL; int spattern_len = 0; diff --git a/ext/intl/normalizer/normalizer_class.c b/ext/intl/normalizer/normalizer_class.cpp similarity index 86% rename from ext/intl/normalizer/normalizer_class.c rename to ext/intl/normalizer/normalizer_class.cpp index d9e413d5e5146..3838f7546325a 100644 --- a/ext/intl/normalizer/normalizer_class.c +++ b/ext/intl/normalizer/normalizer_class.cpp @@ -12,11 +12,22 @@ +----------------------------------------------------------------------+ */ +#if __cplusplus >= 201703L +#include +#endif +#include + #include "normalizer.h" #include "normalizer_class.h" #include "php_intl.h" +#ifdef __cplusplus +extern "C" { +#endif #include "normalizer_arginfo.h" #include "intl_error.h" +#ifdef __cplusplus +} +#endif #include @@ -29,7 +40,7 @@ zend_class_entry *Normalizer_ce_ptr = NULL; /* {{{ normalizer_register_Normalizer_class * Initialize 'Normalizer' class */ -void normalizer_register_Normalizer_class( void ) +U_CFUNC void normalizer_register_Normalizer_class( void ) { /* Create and register 'Normalizer' class. */ Normalizer_ce_ptr = register_class_Normalizer(); diff --git a/ext/intl/normalizer/normalizer_class.h b/ext/intl/normalizer/normalizer_class.h index 6e57cae40ba0e..8f88f215abcca 100644 --- a/ext/intl/normalizer/normalizer_class.h +++ b/ext/intl/normalizer/normalizer_class.h @@ -36,6 +36,12 @@ typedef struct { #define NORMALIZER_ERROR_CODE(co) INTL_ERROR_CODE(NORMALIZER_ERROR(co)) #define NORMALIZER_ERROR_CODE_P(co) &(INTL_ERROR_CODE(NORMALIZER_ERROR(co))) +#ifdef __cplusplus +extern "C" { +#endif void normalizer_register_Normalizer_class( void ); +#ifdef __cplusplus +} +#endif extern zend_class_entry *Normalizer_ce_ptr; #endif // #ifndef NORMALIZER_CLASS_H diff --git a/ext/intl/normalizer/normalizer_normalize.c b/ext/intl/normalizer/normalizer_normalize.cpp similarity index 97% rename from ext/intl/normalizer/normalizer_normalize.c rename to ext/intl/normalizer/normalizer_normalize.cpp index 670042f34d2b0..92e8f1166ad00 100644 --- a/ext/intl/normalizer/normalizer_normalize.c +++ b/ext/intl/normalizer/normalizer_normalize.cpp @@ -16,11 +16,18 @@ #include #endif +#if __cplusplus >= 201703L +#include +#include +#endif + +extern "C" { #include "php_intl.h" #include #include "normalizer.h" #include "normalizer_class.h" #include "intl_convert.h" +} #include @@ -71,7 +78,7 @@ static UBool intl_is_normalized(zend_long form, const UChar *uinput, int32_t uin }/*}}}*/ /* {{{ Normalize a string. */ -PHP_FUNCTION( normalizer_normalize ) +U_CFUNC PHP_FUNCTION( normalizer_normalize ) { char* input = NULL; /* form is optional, defaults to FORM_C */ @@ -200,7 +207,7 @@ PHP_FUNCTION( normalizer_normalize ) /* }}} */ /* {{{ Test if a string is in a given normalization form. */ -PHP_FUNCTION( normalizer_is_normalized ) +U_CFUNC PHP_FUNCTION( normalizer_is_normalized ) { char* input = NULL; /* form is optional, defaults to FORM_C */ @@ -276,7 +283,7 @@ PHP_FUNCTION( normalizer_is_normalized ) /* }}} */ /* {{{ Returns the Decomposition_Mapping property for the given UTF-8 encoded code point. */ -PHP_FUNCTION( normalizer_get_raw_decomposition ) +U_CFUNC PHP_FUNCTION( normalizer_get_raw_decomposition ) { char* input = NULL; size_t input_length = 0; diff --git a/ext/intl/php_intl.stub.php b/ext/intl/php_intl.stub.php index dfb05a2b50ac5..af1ce6f1edbbb 100644 --- a/ext/intl/php_intl.stub.php +++ b/ext/intl/php_intl.stub.php @@ -571,8 +571,7 @@ function intltz_count_equivalent_ids(string $timezoneId): int|false {} function intltz_create_default(): IntlTimeZone {} -/** @param IntlTimeZone|string|int|float|null $countryOrRawOffset */ -function intltz_create_enumeration($countryOrRawOffset = null): IntlIterator|false {} +function intltz_create_enumeration(string|int|null $countryOrRawOffset = null): IntlIterator|false {} function intltz_create_time_zone(string $timezoneId): ?IntlTimeZone {} diff --git a/ext/intl/php_intl_arginfo.h b/ext/intl/php_intl_arginfo.h index 69f55d8199e53..8f3ba5041542b 100644 --- a/ext/intl/php_intl_arginfo.h +++ b/ext/intl/php_intl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 0d5b028a1ab8f35e8ee1b51ce3141b6ef782af28 */ + * Stub hash: bd78e0b6aec5c52b13f83e3c3cc7770c942d7c20 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null") @@ -679,7 +679,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intltz_create_default, 0, 0, Intl ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_intltz_create_enumeration, 0, 0, IntlIterator, MAY_BE_FALSE) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, countryOrRawOffset, "null") + ZEND_ARG_TYPE_MASK(0, countryOrRawOffset, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_NULL, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intltz_create_time_zone, 0, 1, IntlTimeZone, 1) diff --git a/ext/intl/tests/timezone_createEnumeration_error.phpt b/ext/intl/tests/timezone_createEnumeration_error.phpt index 5669f3bda3b2a..fcfc6414876b8 100644 --- a/ext/intl/tests/timezone_createEnumeration_error.phpt +++ b/ext/intl/tests/timezone_createEnumeration_error.phpt @@ -4,10 +4,19 @@ IntlTimeZone::createEnumeration(): errors intl --FILE-- getMessage(), PHP_EOL; +} + +try { + var_dump(IntlTimeZone::createEnumeration(new stdClass())); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), PHP_EOL; +} ?> ---EXPECTF-- -Warning: IntlTimeZone::createEnumeration(): invalid argument type in %s on line %d -bool(false) +--EXPECT-- +TypeError: IntlTimeZone::createEnumeration(): Argument #1 ($countryOrRawOffset) must be of type string|int|null, array given +TypeError: IntlTimeZone::createEnumeration(): Argument #1 ($countryOrRawOffset) must be of type string|int|null, stdClass given diff --git a/ext/intl/timezone/timezone.stub.php b/ext/intl/timezone/timezone.stub.php index c879bb9ce55ed..8a8927f7cd8a2 100644 --- a/ext/intl/timezone/timezone.stub.php +++ b/ext/intl/timezone/timezone.stub.php @@ -45,11 +45,10 @@ public static function countEquivalentIDs(string $timezoneId): int|false {} public static function createDefault(): IntlTimeZone {} /** - * @param IntlTimeZone|string|int|float|null $countryOrRawOffset * @tentative-return-type * @alias intltz_create_enumeration */ - public static function createEnumeration($countryOrRawOffset = null): IntlIterator|false {} + public static function createEnumeration(string|int|null $countryOrRawOffset = null): IntlIterator|false {} /** * @tentative-return-type diff --git a/ext/intl/timezone/timezone_arginfo.h b/ext/intl/timezone/timezone_arginfo.h index 6206e03efad3e..e30e9806d9d53 100644 --- a/ext/intl/timezone/timezone_arginfo.h +++ b/ext/intl/timezone/timezone_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 6ffeea8491aa48c49879fa77bdb644d10d5c71bd */ + * Stub hash: 22e652c6a05ade0a6fd3119e4742cd260ba27146 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlTimeZone___construct, 0, 0, 0) ZEND_END_ARG_INFO() @@ -12,7 +12,7 @@ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_IntlTimeZone_crea ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_IntlTimeZone_createEnumeration, 0, 0, IntlIterator, MAY_BE_FALSE) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, countryOrRawOffset, "null") + ZEND_ARG_TYPE_MASK(0, countryOrRawOffset, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_NULL, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_IntlTimeZone_createTimeZone, 0, 1, IntlTimeZone, 1) diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp index 3fdfbb9ac8074..e9b48273dd257 100644 --- a/ext/intl/timezone/timezone_methods.cpp +++ b/ext/intl/timezone/timezone_methods.cpp @@ -125,62 +125,35 @@ U_CFUNC PHP_FUNCTION(intltz_get_unknown) U_CFUNC PHP_FUNCTION(intltz_create_enumeration) { - zval *arg = NULL; - StringEnumeration *se = NULL; - intl_error_reset(NULL); + zend_string *timezone = nullptr; + zend_long timezone_shift = 0; + bool is_null = true; + StringEnumeration *se = nullptr; + intl_error_reset(nullptr); /* double indirection to have the zend engine destroy the new zval that * results from separation */ ZEND_PARSE_PARAMETERS_START(0, 1) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(arg) + Z_PARAM_STR_OR_LONG_OR_NULL(timezone, timezone_shift, is_null) ZEND_PARSE_PARAMETERS_END(); - if (arg == NULL || Z_TYPE_P(arg) == IS_NULL) { + if (is_null) { se = TimeZone::createEnumeration(); - } else if (Z_TYPE_P(arg) == IS_LONG) { -int_offset: - if (UNEXPECTED(Z_LVAL_P(arg) < (zend_long)INT32_MIN || - Z_LVAL_P(arg) > (zend_long)INT32_MAX)) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "value is out of range"); - RETURN_FALSE; - } else { - se = TimeZone::createEnumeration((int32_t) Z_LVAL_P(arg)); - } - } else if (Z_TYPE_P(arg) == IS_DOUBLE) { -double_offset: - convert_to_long(arg); - goto int_offset; - } else if (Z_TYPE_P(arg) == IS_OBJECT || Z_TYPE_P(arg) == IS_STRING) { - zend_long lval; - double dval; - if (!try_convert_to_string(arg)) { + } else if (timezone != nullptr) { + se = TimeZone::createEnumeration(ZSTR_VAL(timezone)); + } else { + if (UNEXPECTED(ZEND_LONG_EXCEEDS_INT(timezone_shift))) { + zend_argument_value_error(1, "must be between %d and %d", INT32_MIN, INT32_MAX); RETURN_THROWS(); } - switch (is_numeric_string(Z_STRVAL_P(arg), Z_STRLEN_P(arg), &lval, &dval, 0)) { - case IS_DOUBLE: - zval_ptr_dtor(arg); - ZVAL_DOUBLE(arg, dval); - goto double_offset; - case IS_LONG: - zval_ptr_dtor(arg); - ZVAL_LONG(arg, lval); - goto int_offset; - } - /* else call string version */ - se = TimeZone::createEnumeration(Z_STRVAL_P(arg)); - } else { - // TODO Should be a TypeError - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "invalid argument type"); - RETURN_FALSE; + se = TimeZone::createEnumeration(static_cast(timezone_shift)); } if (se) { IntlIterator_from_StringEnumeration(se, return_value); } else { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, + intl_error_set(nullptr, U_ILLEGAL_ARGUMENT_ERROR, "error obtaining enumeration"); RETVAL_FALSE; } diff --git a/ext/sockets/tests/socket_export_stream-5.phpt b/ext/sockets/tests/socket_export_stream-5.phpt deleted file mode 100644 index ffad1935b64be..0000000000000 --- a/ext/sockets/tests/socket_export_stream-5.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -socket_export_stream: effects of leaked handles ---EXTENSIONS-- -sockets -zend_test ---INI-- -report_memleaks=0 ---FILE-- - ---EXPECT-- -Done. diff --git a/ext/sockets/tests/socket_import_stream-5.phpt b/ext/sockets/tests/socket_import_stream-5.phpt deleted file mode 100644 index 9a684d054ba0e..0000000000000 --- a/ext/sockets/tests/socket_import_stream-5.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -socket_import_stream: effects of leaked handles ---EXTENSIONS-- -sockets -zend_test ---INI-- -report_memleaks=0 ---FILE-- - ---EXPECT-- -Done. diff --git a/ext/standard/tests/file/parse_ini_file_variation3.phpt b/ext/standard/tests/file/parse_ini_file_variation3.phpt index 29e620dc8da3e..8485e8d01ef01 100644 --- a/ext/standard/tests/file/parse_ini_file_variation3.phpt +++ b/ext/standard/tests/file/parse_ini_file_variation3.phpt @@ -35,7 +35,6 @@ display_startup_errors = Off log_errors = Off ignore_repeated_errors = Off ignore_repeated_source = Off -report_memleaks = On docref_root = "/phpmanual/" docref_ext = .html @@ -68,7 +67,7 @@ foreach($newdirs as $newdir) { --EXPECTF-- *** Testing parse_ini_file() : variation *** New include path is : %sparse_ini_file_variation3.dir1%sparse_ini_file_variation3.dir2%sparse_ini_file_variation3.dir3%S -array(9) { +array(8) { ["error_reporting"]=> string(5) "30719" ["display_errors"]=> @@ -81,8 +80,6 @@ array(9) { string(0) "" ["ignore_repeated_source"]=> string(0) "" - ["report_memleaks"]=> - string(1) "1" ["docref_root"]=> string(11) "/phpmanual/" ["docref_ext"]=> diff --git a/ext/standard/tests/serialize/unserialize_mem_leak.phpt b/ext/standard/tests/serialize/unserialize_mem_leak.phpt index 3ddb74a273df5..bad689c3705ad 100644 --- a/ext/standard/tests/serialize/unserialize_mem_leak.phpt +++ b/ext/standard/tests/serialize/unserialize_mem_leak.phpt @@ -1,7 +1,5 @@ --TEST-- Memleaks if unserialize return a self-referenced array/object ---INI-- -report_memleaks=1 --FILE--