diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 7da6810a111eb..b851439e396bf 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2758,39 +2758,38 @@ static zend_always_inline void zend_assign_to_property_reference(zval *container zend_fetch_property_address(variable_ptr, container, container_op_type, prop_ptr, prop_op_type, cache_addr, BP_VAR_W, 0, 0 OPLINE_CC EXECUTE_DATA_CC); - if (Z_TYPE_P(variable_ptr) == IS_INDIRECT) { + if (EXPECTED(Z_TYPE_P(variable_ptr) == IS_INDIRECT)) { variable_ptr = Z_INDIRECT_P(variable_ptr); - } + if (/*OP_DATA_TYPE == IS_VAR &&*/ + (opline->extended_value & ZEND_RETURNS_FUNCTION) && + UNEXPECTED(!Z_ISREF_P(value_ptr))) { + + if (UNEXPECTED(!zend_wrong_assign_to_variable_reference( + variable_ptr, value_ptr OPLINE_CC EXECUTE_DATA_CC))) { + variable_ptr = &EG(uninitialized_zval); + } + } else { + zend_property_info *prop_info = NULL; + + if (prop_op_type == IS_CONST) { + prop_info = (zend_property_info *) CACHED_PTR_EX(cache_addr + 2); + } else { + ZVAL_DEREF(container); + prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(container), variable_ptr); + } - if (UNEXPECTED(Z_ISERROR_P(variable_ptr))) { + if (UNEXPECTED(prop_info)) { + variable_ptr = zend_assign_to_typed_property_reference(prop_info, variable_ptr, value_ptr EXECUTE_DATA_CC); + } else { + zend_assign_to_variable_reference(variable_ptr, value_ptr); + } + } + } else if (Z_ISERROR_P(variable_ptr)) { variable_ptr = &EG(uninitialized_zval); - } else if (UNEXPECTED(Z_TYPE(variable) != IS_INDIRECT)) { + } else { zend_throw_error(NULL, "Cannot assign by reference to overloaded object"); zval_ptr_dtor(&variable); variable_ptr = &EG(uninitialized_zval); - } else if (/*OP_DATA_TYPE == IS_VAR &&*/ - (opline->extended_value & ZEND_RETURNS_FUNCTION) && - UNEXPECTED(!Z_ISREF_P(value_ptr))) { - - if (UNEXPECTED(!zend_wrong_assign_to_variable_reference( - variable_ptr, value_ptr OPLINE_CC EXECUTE_DATA_CC))) { - variable_ptr = &EG(uninitialized_zval); - } - } else { - zend_property_info *prop_info = NULL; - - if (prop_op_type == IS_CONST) { - prop_info = (zend_property_info *) CACHED_PTR_EX(cache_addr + 2); - } else { - ZVAL_DEREF(container); - prop_info = zend_object_fetch_property_type_info(Z_OBJ_P(container), variable_ptr); - } - - if (UNEXPECTED(prop_info)) { - variable_ptr = zend_assign_to_typed_property_reference(prop_info, variable_ptr, value_ptr EXECUTE_DATA_CC); - } else { - zend_assign_to_variable_reference(variable_ptr, value_ptr); - } } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { diff --git a/ext/intl/breakiterator/breakiterator.stub.php b/ext/intl/breakiterator/breakiterator.stub.php new file mode 100644 index 0000000000000..663932d64e46e --- /dev/null +++ b/ext/intl/breakiterator/breakiterator.stub.php @@ -0,0 +1,95 @@ + @@ -285,11 +286,8 @@ U_CFUNC PHP_METHOD(IntlPartsIterator, getBreakIterator) ZVAL_COPY_DEREF(return_value, biter_zval); } -ZEND_BEGIN_ARG_INFO_EX(ainfo_parts_it_void, 0, 0, 0) -ZEND_END_ARG_INFO() - static const zend_function_entry IntlPartsIterator_class_functions[] = { - PHP_ME(IntlPartsIterator, getBreakIterator, ainfo_parts_it_void, ZEND_ACC_PUBLIC) + PHP_ME(IntlPartsIterator, getBreakIterator, arginfo_class_IntlPartsIterator_getBreakIterator, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/intl/breakiterator/breakiterator_methods.cpp b/ext/intl/breakiterator/breakiterator_methods.cpp index fc1c813499b5a..3c9e93b160283 100644 --- a/ext/intl/breakiterator/breakiterator_methods.cpp +++ b/ext/intl/breakiterator/breakiterator_methods.cpp @@ -73,42 +73,42 @@ static void _breakiter_factory(const char *func_name, breakiterator_object_create(return_value, biter, 1); } -U_CFUNC PHP_FUNCTION(breakiter_create_word_instance) +U_CFUNC PHP_METHOD(BreakIterator, createWordInstance) { _breakiter_factory("breakiter_create_word_instance", &BreakIterator::createWordInstance, INTERNAL_FUNCTION_PARAM_PASSTHRU); } -U_CFUNC PHP_FUNCTION(breakiter_create_line_instance) +U_CFUNC PHP_METHOD(BreakIterator, createLineInstance) { _breakiter_factory("breakiter_create_line_instance", &BreakIterator::createLineInstance, INTERNAL_FUNCTION_PARAM_PASSTHRU); } -U_CFUNC PHP_FUNCTION(breakiter_create_character_instance) +U_CFUNC PHP_METHOD(BreakIterator, createCharacterInstance) { _breakiter_factory("breakiter_create_character_instance", &BreakIterator::createCharacterInstance, INTERNAL_FUNCTION_PARAM_PASSTHRU); } -U_CFUNC PHP_FUNCTION(breakiter_create_sentence_instance) +U_CFUNC PHP_METHOD(BreakIterator, createSentenceInstance) { _breakiter_factory("breakiter_create_sentence_instance", &BreakIterator::createSentenceInstance, INTERNAL_FUNCTION_PARAM_PASSTHRU); } -U_CFUNC PHP_FUNCTION(breakiter_create_title_instance) +U_CFUNC PHP_METHOD(BreakIterator, createTitleInstance) { _breakiter_factory("breakiter_create_title_instance", &BreakIterator::createTitleInstance, INTERNAL_FUNCTION_PARAM_PASSTHRU); } -U_CFUNC PHP_FUNCTION(breakiter_create_code_point_instance) +U_CFUNC PHP_METHOD(BreakIterator, createCodePointInstance) { intl_error_reset(NULL); @@ -120,7 +120,7 @@ U_CFUNC PHP_FUNCTION(breakiter_create_code_point_instance) breakiterator_object_create(return_value, cpbi, 1); } -U_CFUNC PHP_FUNCTION(breakiter_get_text) +U_CFUNC PHP_METHOD(BreakIterator, getText) { BREAKITER_METHOD_INIT_VARS; object = ZEND_THIS; @@ -138,7 +138,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_text) } } -U_CFUNC PHP_FUNCTION(breakiter_set_text) +U_CFUNC PHP_METHOD(BreakIterator, setText) { UText *ut = NULL; zend_string *text; @@ -217,28 +217,28 @@ static void _breakiter_int32_ret_int32( RETURN_LONG((zend_long)res); } -U_CFUNC PHP_FUNCTION(breakiter_first) +U_CFUNC PHP_METHOD(BreakIterator, first) { _breakiter_no_args_ret_int32("breakiter_first", &BreakIterator::first, INTERNAL_FUNCTION_PARAM_PASSTHRU); } -U_CFUNC PHP_FUNCTION(breakiter_last) +U_CFUNC PHP_METHOD(BreakIterator, last) { _breakiter_no_args_ret_int32("breakiter_last", &BreakIterator::last, INTERNAL_FUNCTION_PARAM_PASSTHRU); } -U_CFUNC PHP_FUNCTION(breakiter_previous) +U_CFUNC PHP_METHOD(BreakIterator, previous) { _breakiter_no_args_ret_int32("breakiter_previous", &BreakIterator::previous, INTERNAL_FUNCTION_PARAM_PASSTHRU); } -U_CFUNC PHP_FUNCTION(breakiter_next) +U_CFUNC PHP_METHOD(BreakIterator, next) { bool no_arg_version = false; @@ -267,7 +267,7 @@ U_CFUNC PHP_FUNCTION(breakiter_next) } } -U_CFUNC PHP_FUNCTION(breakiter_current) +U_CFUNC PHP_METHOD(BreakIterator, current) { BREAKITER_METHOD_INIT_VARS; object = ZEND_THIS; @@ -283,21 +283,21 @@ U_CFUNC PHP_FUNCTION(breakiter_current) RETURN_LONG((zend_long)res); } -U_CFUNC PHP_FUNCTION(breakiter_following) +U_CFUNC PHP_METHOD(BreakIterator, following) { _breakiter_int32_ret_int32("breakiter_following", &BreakIterator::following, INTERNAL_FUNCTION_PARAM_PASSTHRU); } -U_CFUNC PHP_FUNCTION(breakiter_preceding) +U_CFUNC PHP_METHOD(BreakIterator, preceding) { _breakiter_int32_ret_int32("breakiter_preceding", &BreakIterator::preceding, INTERNAL_FUNCTION_PARAM_PASSTHRU); } -U_CFUNC PHP_FUNCTION(breakiter_is_boundary) +U_CFUNC PHP_METHOD(BreakIterator, isBoundary) { zend_long offset; BREAKITER_METHOD_INIT_VARS; @@ -322,7 +322,7 @@ U_CFUNC PHP_FUNCTION(breakiter_is_boundary) RETURN_BOOL((zend_long)res); } -U_CFUNC PHP_FUNCTION(breakiter_get_locale) +U_CFUNC PHP_METHOD(BreakIterator, getLocale) { zend_long locale_type; BREAKITER_METHOD_INIT_VARS; @@ -348,7 +348,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_locale) RETURN_STRING(locale.getName()); } -U_CFUNC PHP_FUNCTION(breakiter_get_parts_iterator) +U_CFUNC PHP_METHOD(BreakIterator, getPartsIterator) { zend_long key_type = 0; BREAKITER_METHOD_INIT_VARS; @@ -372,7 +372,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_parts_iterator) object, return_value, (parts_iter_key_type)key_type); } -U_CFUNC PHP_FUNCTION(breakiter_get_error_code) +U_CFUNC PHP_METHOD(BreakIterator, getErrorCode) { BREAKITER_METHOD_INIT_VARS; object = ZEND_THIS; @@ -386,7 +386,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_code) RETURN_LONG((zend_long)BREAKITER_ERROR_CODE(bio)); } -U_CFUNC PHP_FUNCTION(breakiter_get_error_message) +U_CFUNC PHP_METHOD(BreakIterator, getErrorMessage) { zend_string* message = NULL; BREAKITER_METHOD_INIT_VARS; diff --git a/ext/intl/breakiterator/breakiterator_methods.h b/ext/intl/breakiterator/breakiterator_methods.h index 2aef4594411b3..880fdc168f3fe 100644 --- a/ext/intl/breakiterator/breakiterator_methods.h +++ b/ext/intl/breakiterator/breakiterator_methods.h @@ -19,44 +19,44 @@ PHP_METHOD(BreakIterator, __construct); -PHP_FUNCTION(breakiter_create_word_instance); +PHP_METHOD(BreakIterator, createWordInstance); -PHP_FUNCTION(breakiter_create_line_instance); +PHP_METHOD(BreakIterator, createLineInstance); -PHP_FUNCTION(breakiter_create_character_instance); +PHP_METHOD(BreakIterator, createCharacterInstance); -PHP_FUNCTION(breakiter_create_sentence_instance); +PHP_METHOD(BreakIterator, createSentenceInstance); -PHP_FUNCTION(breakiter_create_title_instance); +PHP_METHOD(BreakIterator, createTitleInstance); -PHP_FUNCTION(breakiter_create_code_point_instance); +PHP_METHOD(BreakIterator, createCodePointInstance); -PHP_FUNCTION(breakiter_get_text); +PHP_METHOD(BreakIterator, getText); -PHP_FUNCTION(breakiter_set_text); +PHP_METHOD(BreakIterator, setText); -PHP_FUNCTION(breakiter_first); +PHP_METHOD(BreakIterator, first); -PHP_FUNCTION(breakiter_last); +PHP_METHOD(BreakIterator, last); -PHP_FUNCTION(breakiter_previous); +PHP_METHOD(BreakIterator, previous); -PHP_FUNCTION(breakiter_next); +PHP_METHOD(BreakIterator, next); -PHP_FUNCTION(breakiter_current); +PHP_METHOD(BreakIterator, current); -PHP_FUNCTION(breakiter_following); +PHP_METHOD(BreakIterator, following); -PHP_FUNCTION(breakiter_preceding); +PHP_METHOD(BreakIterator, preceding); -PHP_FUNCTION(breakiter_is_boundary); +PHP_METHOD(BreakIterator, isBoundary); -PHP_FUNCTION(breakiter_get_locale); +PHP_METHOD(BreakIterator, getLocale); -PHP_FUNCTION(breakiter_get_parts_iterator); +PHP_METHOD(BreakIterator, getPartsIterator); -PHP_FUNCTION(breakiter_get_error_code); +PHP_METHOD(BreakIterator, getErrorCode); -PHP_FUNCTION(breakiter_get_error_message); +PHP_METHOD(BreakIterator, getErrorMessage); #endif diff --git a/ext/intl/breakiterator/codepointiterator_methods.cpp b/ext/intl/breakiterator/codepointiterator_methods.cpp index 12df7949257e5..6409b5e05cf4d 100644 --- a/ext/intl/breakiterator/codepointiterator_methods.cpp +++ b/ext/intl/breakiterator/codepointiterator_methods.cpp @@ -25,7 +25,7 @@ static inline CodePointBreakIterator *fetch_cpbi(BreakIterator_object *bio) { return (CodePointBreakIterator*)bio->biter; } -U_CFUNC PHP_FUNCTION(cpbi_get_last_code_point) +U_CFUNC PHP_METHOD(IntlCodePointBreakIterator, getLastCodePoint) { BREAKITER_METHOD_INIT_VARS; object = ZEND_THIS; diff --git a/ext/intl/breakiterator/codepointiterator_methods.h b/ext/intl/breakiterator/codepointiterator_methods.h index 867326cada3c8..04576d0eb1d1d 100644 --- a/ext/intl/breakiterator/codepointiterator_methods.h +++ b/ext/intl/breakiterator/codepointiterator_methods.h @@ -17,6 +17,6 @@ #include -PHP_FUNCTION(cpbi_get_last_code_point); +PHP_METHOD(IntlCodePointBreakIterator, getLastCodePoint); #endif diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp index 04031733d94ce..3e49b1ceb3172 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp @@ -95,7 +95,7 @@ U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct) zend_restore_error_handling(&error_handling); } -U_CFUNC PHP_FUNCTION(rbbi_get_rules) +U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, getRules) { BREAKITER_METHOD_INIT_VARS; object = ZEND_THIS; @@ -120,7 +120,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rules) RETVAL_STR(u8str); } -U_CFUNC PHP_FUNCTION(rbbi_get_rule_status) +U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, getRuleStatus) { BREAKITER_METHOD_INIT_VARS; object = ZEND_THIS; @@ -134,7 +134,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status) RETURN_LONG(fetch_rbbi(bio)->getRuleStatus()); } -U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec) +U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, getRuleStatusVec) { BREAKITER_METHOD_INIT_VARS; object = ZEND_THIS; @@ -172,7 +172,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec) delete[] rules; } -U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules) +U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, getBinaryRules) { BREAKITER_METHOD_INIT_VARS; object = ZEND_THIS; diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.h b/ext/intl/breakiterator/rulebasedbreakiterator_methods.h index 88528f928e76f..9b6802bcfaa35 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.h +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.h @@ -19,12 +19,12 @@ PHP_METHOD(IntlRuleBasedBreakIterator, __construct); -PHP_FUNCTION(rbbi_get_rules); +PHP_METHOD(IntlRuleBasedBreakIterator, getRules); -PHP_FUNCTION(rbbi_get_rule_status); +PHP_METHOD(IntlRuleBasedBreakIterator, getRuleStatus); -PHP_FUNCTION(rbbi_get_rule_status_vec); +PHP_METHOD(IntlRuleBasedBreakIterator, getRuleStatusVec); -PHP_FUNCTION(rbbi_get_binary_rules); +PHP_METHOD(IntlRuleBasedBreakIterator, getBinaryRules); #endif