summaryrefslogtreecommitdiff
path: root/ext/intl/msgformat/msgformat.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/msgformat/msgformat.c')
-rw-r--r--ext/intl/msgformat/msgformat.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c
index 707b38bd95..15d6ef8321 100644
--- a/ext/intl/msgformat/msgformat.c
+++ b/ext/intl/msgformat/msgformat.c
@@ -108,15 +108,17 @@ PHP_FUNCTION( msgfmt_create )
*/
PHP_METHOD( MessageFormatter, __construct )
{
- zval orig_this = *getThis();
+ zend_error_handling error_handling;
+ zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling);
return_value = getThis();
msgfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this));
- ZEND_CTOR_MAKE_NULL();
+ if (!EG(exception)) {
+ zend_throw_exception(IntlException_ce_ptr, "Constructor failed", 0);
+ }
}
+ zend_restore_error_handling(&error_handling);
}
/* }}} */