mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Allowing catching arg type deprecations in intl classes
Closes GH-8115 Closes GH-8117
This commit is contained in:
parent
723058c3bf
commit
925a30979c
10 changed files with 136 additions and 39 deletions
|
@ -31,7 +31,7 @@ static inline RuleBasedBreakIterator *fetch_rbbi(BreakIterator_object *bio) {
|
|||
return (RuleBasedBreakIterator*)bio->biter;
|
||||
}
|
||||
|
||||
static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
|
||||
static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS, zend_error_handling *error_handling, bool *error_handling_replaced)
|
||||
{
|
||||
char *rules;
|
||||
size_t rules_len;
|
||||
|
@ -51,6 +51,9 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
|
|||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, error_handling);
|
||||
*error_handling_replaced = 1;
|
||||
|
||||
// instantiation of ICU object
|
||||
RuleBasedBreakIterator *rbbi;
|
||||
|
||||
|
@ -95,11 +98,13 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
|
|||
U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct)
|
||||
{
|
||||
zend_error_handling error_handling;
|
||||
bool error_handling_replaced = 0;
|
||||
|
||||
zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling);
|
||||
return_value = ZEND_THIS;
|
||||
_php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
zend_restore_error_handling(&error_handling);
|
||||
_php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAM_PASSTHRU, &error_handling, &error_handling_replaced);
|
||||
if (error_handling_replaced) {
|
||||
zend_restore_error_handling(&error_handling);
|
||||
}
|
||||
}
|
||||
|
||||
U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, getRules)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue