From d594fba3ac7afc591ab4082c5f13f8f96fffa451 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 25 Feb 2020 17:23:46 +0100 Subject: [PATCH 1/3] Reorder checks in object ref assignment First check for IS_INDIRECT and de-indirect it directly there. Handle the error cases later. --- Zend/zend_execute.c | 53 ++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 27 deletions(-) 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))) { From c0d68b1f9da36f332bd54f58ff37e561cee65ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Mon, 24 Feb 2020 23:54:49 +0100 Subject: [PATCH 2/3] Add stubs for Intl BreakIterator --- ext/intl/breakiterator/breakiterator.stub.php | 95 +++++++++++++++++++ .../breakiterator/breakiterator_arginfo.h | 73 ++++++++++++++ .../breakiterator/breakiterator_class.cpp | 93 ++++++------------ .../breakiterator/breakiterator_iterators.cpp | 6 +- 4 files changed, 199 insertions(+), 68 deletions(-) create mode 100644 ext/intl/breakiterator/breakiterator.stub.php create mode 100644 ext/intl/breakiterator/breakiterator_arginfo.h 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 }; From 4b41bfbce9cae5364e0a15acf75563d0a5df4b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Tue, 25 Feb 2020 19:57:23 +0100 Subject: [PATCH 3/3] Get rid of method mapping of BreakIterator classes --- .../breakiterator/breakiterator_class.cpp | 58 +++++++++---------- .../breakiterator/breakiterator_methods.cpp | 40 ++++++------- .../breakiterator/breakiterator_methods.h | 40 ++++++------- .../codepointiterator_methods.cpp | 2 +- .../breakiterator/codepointiterator_methods.h | 2 +- .../rulebasedbreakiterator_methods.cpp | 8 +-- .../rulebasedbreakiterator_methods.h | 8 +-- 7 files changed, 79 insertions(+), 79 deletions(-) diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp index abbc413c5c2a6..301701d29e143 100644 --- a/ext/intl/breakiterator/breakiterator_class.cpp +++ b/ext/intl/breakiterator/breakiterator_class.cpp @@ -222,31 +222,31 @@ static zend_object *BreakIterator_object_create(zend_class_entry *ce) /* }}} */ /* {{{ BreakIterator_class_functions - * Every 'BreakIterator' class method has an entry in this table + * Every 'IntlBreakIterator' class method has an entry in this table */ static const zend_function_entry BreakIterator_class_functions[] = { - PHP_ME(BreakIterator, __construct, arginfo_class_IntlBreakIterator___construct, ZEND_ACC_PRIVATE) - PHP_ME_MAPPING(createWordInstance, breakiter_create_word_instance, arginfo_class_IntlBreakIterator_createWordInstance, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(createLineInstance, breakiter_create_line_instance, arginfo_class_IntlBreakIterator_createLineInstance, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(createCharacterInstance, breakiter_create_character_instance, arginfo_class_IntlBreakIterator_createCharacterInstance, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(createSentenceInstance, breakiter_create_sentence_instance, arginfo_class_IntlBreakIterator_createSentenceInstance, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(createTitleInstance, breakiter_create_title_instance, arginfo_class_IntlBreakIterator_createTitleInstance, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(createCodePointInstance, breakiter_create_code_point_instance, arginfo_class_IntlBreakIterator_createCodePointInstance, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(getText, breakiter_get_text, arginfo_class_IntlBreakIterator_getText, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(setText, breakiter_set_text, arginfo_class_IntlBreakIterator_setText, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(first, breakiter_first, arginfo_class_IntlBreakIterator_first, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(last, breakiter_last, arginfo_class_IntlBreakIterator_last, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(previous, breakiter_previous, arginfo_class_IntlBreakIterator_previous, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(next, breakiter_next, arginfo_class_IntlBreakIterator_next, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(current, breakiter_current, arginfo_class_IntlBreakIterator_current, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(following, breakiter_following, arginfo_class_IntlBreakIterator_following, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(preceding, breakiter_preceding, arginfo_class_IntlBreakIterator_preceding, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(isBoundary, breakiter_is_boundary, arginfo_class_IntlBreakIterator_isBoundary, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(getLocale, breakiter_get_locale, arginfo_class_IntlBreakIterator_getLocale, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(getPartsIterator, breakiter_get_parts_iterator, arginfo_class_IntlBreakIterator_getPartsIterator, ZEND_ACC_PUBLIC) - - PHP_ME_MAPPING(getErrorCode, breakiter_get_error_code, arginfo_class_IntlBreakIterator_getErrorCode, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(getErrorMessage, breakiter_get_error_message, arginfo_class_IntlBreakIterator_getErrorMessage, ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, __construct, arginfo_class_IntlBreakIterator___construct, ZEND_ACC_PRIVATE) + PHP_ME(BreakIterator, createWordInstance, arginfo_class_IntlBreakIterator_createWordInstance, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, createLineInstance, arginfo_class_IntlBreakIterator_createLineInstance, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, createCharacterInstance, arginfo_class_IntlBreakIterator_createCharacterInstance, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, createSentenceInstance, arginfo_class_IntlBreakIterator_createSentenceInstance, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, createTitleInstance, arginfo_class_IntlBreakIterator_createTitleInstance, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, createCodePointInstance, arginfo_class_IntlBreakIterator_createCodePointInstance, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, getText, arginfo_class_IntlBreakIterator_getText, ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, setText, arginfo_class_IntlBreakIterator_setText, ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, first, arginfo_class_IntlBreakIterator_first, ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, last, arginfo_class_IntlBreakIterator_last, ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, previous, arginfo_class_IntlBreakIterator_previous, ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, next, arginfo_class_IntlBreakIterator_next, ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, current, arginfo_class_IntlBreakIterator_current, ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, following, arginfo_class_IntlBreakIterator_following, ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, preceding, arginfo_class_IntlBreakIterator_preceding, ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, isBoundary, arginfo_class_IntlBreakIterator_isBoundary, ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, getLocale, arginfo_class_IntlBreakIterator_getLocale, ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, getPartsIterator, arginfo_class_IntlBreakIterator_getPartsIterator, ZEND_ACC_PUBLIC) + + PHP_ME(BreakIterator, getErrorCode, arginfo_class_IntlBreakIterator_getErrorCode, ZEND_ACC_PUBLIC) + PHP_ME(BreakIterator, getErrorMessage, arginfo_class_IntlBreakIterator_getErrorMessage, ZEND_ACC_PUBLIC) PHP_FE_END }; /* }}} */ @@ -254,11 +254,11 @@ static const zend_function_entry BreakIterator_class_functions[] = { /* {{{ RuleBasedBreakIterator_class_functions */ static const zend_function_entry RuleBasedBreakIterator_class_functions[] = { - PHP_ME(IntlRuleBasedBreakIterator, __construct, arginfo_class_IntlRuleBasedBreakIterator___construct, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(getRules, rbbi_get_rules, arginfo_class_IntlRuleBasedBreakIterator_getRules, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(getRuleStatus, rbbi_get_rule_status, arginfo_class_IntlRuleBasedBreakIterator_getRuleStatus, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(getRuleStatusVec, rbbi_get_rule_status_vec, arginfo_class_IntlRuleBasedBreakIterator_getRuleStatusVec, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(getBinaryRules, rbbi_get_binary_rules, arginfo_class_IntlRuleBasedBreakIterator_getBinaryRules, ZEND_ACC_PUBLIC) + PHP_ME(IntlRuleBasedBreakIterator, __construct, arginfo_class_IntlRuleBasedBreakIterator___construct, ZEND_ACC_PUBLIC) + PHP_ME(IntlRuleBasedBreakIterator, getRules, arginfo_class_IntlRuleBasedBreakIterator_getRules, ZEND_ACC_PUBLIC) + PHP_ME(IntlRuleBasedBreakIterator, getRuleStatus, arginfo_class_IntlRuleBasedBreakIterator_getRuleStatus, ZEND_ACC_PUBLIC) + PHP_ME(IntlRuleBasedBreakIterator, getRuleStatusVec, arginfo_class_IntlRuleBasedBreakIterator_getRuleStatusVec, ZEND_ACC_PUBLIC) + PHP_ME(IntlRuleBasedBreakIterator, getBinaryRules, arginfo_class_IntlRuleBasedBreakIterator_getBinaryRules, ZEND_ACC_PUBLIC) PHP_FE_END }; /* }}} */ @@ -266,7 +266,7 @@ static const zend_function_entry RuleBasedBreakIterator_class_functions[] = { /* {{{ CodePointBreakIterator_class_functions */ static const zend_function_entry CodePointBreakIterator_class_functions[] = { - PHP_ME_MAPPING(getLastCodePoint, cpbi_get_last_code_point, arginfo_class_IntlCodePointBreakIterator_getLastCodePoint, ZEND_ACC_PUBLIC) + PHP_ME(IntlCodePointBreakIterator, getLastCodePoint, arginfo_class_IntlCodePointBreakIterator_getLastCodePoint, 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