summaryrefslogtreecommitdiff
path: root/ext/intl/dateformat/dateformat_create.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/dateformat/dateformat_create.cpp')
-rw-r--r--ext/intl/dateformat/dateformat_create.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp
index f8cf77641f..b7ad7b5126 100644
--- a/ext/intl/dateformat/dateformat_create.cpp
+++ b/ext/intl/dateformat/dateformat_create.cpp
@@ -34,6 +34,7 @@ extern "C" {
}
#include "dateformat_helpers.h"
+#include "zend_exceptions.h"
/* {{{ */
static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
@@ -187,16 +188,18 @@ U_CFUNC PHP_FUNCTION( datefmt_create )
*/
U_CFUNC PHP_METHOD( IntlDateFormatter, __construct )
{
- zval orig_this = *getThis();
+ zend_error_handling error_handling;
+ zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling);
/* return_value param is being changed, therefore we will always return
* NULL here */
return_value = getThis();
datefmt_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);
}
/* }}} */