Implement typed properties

RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
This commit is contained in:
Nikita Popov 2019-01-07 12:28:51 +01:00
parent fe8fdfa3bd
commit e219ec144e
210 changed files with 22678 additions and 5594 deletions

View file

@ -970,7 +970,7 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ *
Z_PARAM_STR(regex)
Z_PARAM_STR(subject)
Z_PARAM_OPTIONAL
Z_PARAM_ZVAL_DEREF(subpats)
Z_PARAM_ZVAL(subpats)
Z_PARAM_LONG(flags)
Z_PARAM_LONG(start_offset)
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
@ -1014,8 +1014,10 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, size_t sub
/* Overwrite the passed-in value for subpatterns with an empty array. */
if (subpats != NULL) {
zval_ptr_dtor(subpats);
array_init(subpats);
subpats = zend_try_array_init(subpats);
if (!subpats) {
return;
}
}
subpats_order = global ? PREG_PATTERN_ORDER : 0;
@ -2239,7 +2241,7 @@ static void preg_replace_common(INTERNAL_FUNCTION_PARAMETERS, int is_filter)
Z_PARAM_ZVAL(subject)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(limit)
Z_PARAM_ZVAL_DEREF(zcount)
Z_PARAM_ZVAL(zcount)
ZEND_PARSE_PARAMETERS_END();
if (Z_TYPE_P(replace) != IS_ARRAY) {
@ -2305,8 +2307,7 @@ static void preg_replace_common(INTERNAL_FUNCTION_PARAMETERS, int is_filter)
}
if (zcount) {
zval_ptr_dtor(zcount);
ZVAL_LONG(zcount, replace_count);
ZEND_TRY_ASSIGN_LONG(zcount, replace_count);
}
}
/* }}} */
@ -2336,7 +2337,7 @@ static PHP_FUNCTION(preg_replace_callback)
Z_PARAM_ZVAL(subject)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(limit)
Z_PARAM_ZVAL_DEREF(zcount)
Z_PARAM_ZVAL(zcount)
ZEND_PARSE_PARAMETERS_END();
if (!zend_is_callable_ex(replace, NULL, 0, NULL, &fcc, NULL)) {
@ -2353,8 +2354,7 @@ static PHP_FUNCTION(preg_replace_callback)
replace_count = preg_replace_func_impl(return_value, regex, &fci, &fcc, subject, limit);
if (zcount) {
zval_ptr_dtor(zcount);
ZVAL_LONG(zcount, replace_count);
ZEND_TRY_ASSIGN_LONG(zcount, replace_count);
}
}
/* }}} */
@ -2376,7 +2376,7 @@ static PHP_FUNCTION(preg_replace_callback_array)
Z_PARAM_ZVAL(subject)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(limit)
Z_PARAM_ZVAL_DEREF(zcount)
Z_PARAM_ZVAL(zcount)
ZEND_PARSE_PARAMETERS_END();
fci.size = sizeof(fci);
@ -2421,8 +2421,7 @@ static PHP_FUNCTION(preg_replace_callback_array)
} ZEND_HASH_FOREACH_END();
if (zcount) {
zval_ptr_dtor(zcount);
ZVAL_LONG(zcount, replace_count);
ZEND_TRY_ASSIGN_LONG(zcount, replace_count);
}
}
/* }}} */