diff options
Diffstat (limited to 'ext/spl/spl_array.c')
-rwxr-xr-x | ext/spl/spl_array.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 653a6a785a..ca4f2afc9f 100755 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -909,7 +909,6 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval **a intern->array = *array; } else { if (Z_TYPE_PP(array) != IS_OBJECT && Z_TYPE_PP(array) != IS_ARRAY) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC); return; } @@ -928,7 +927,6 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval **a zend_object_get_properties_t handler = Z_OBJ_HANDLER_PP(array, get_properties); if ((handler != std_object_handlers.get_properties && handler != spl_array_get_properties) || !spl_array_get_hash_table(intern, 0 TSRMLS_CC)) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Overloaded object of type %s is not compatible with %s", Z_OBJCE_PP(array)->name, intern->std.ce->name); } } @@ -985,19 +983,18 @@ SPL_METHOD(Array, __construct) if (ZEND_NUM_ARGS() == 0) { return; /* nothing to do */ } - php_set_error_handling(EH_THROW, spl_ce_InvalidArgumentException TSRMLS_CC); + + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, NULL TSRMLS_CC); intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|ls", &array, &ar_flags, &class_name, &class_name_len) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } if (ZEND_NUM_ARGS() > 2) { if (zend_lookup_class(class_name, class_name_len, &pce_get_iterator TSRMLS_CC) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, "A class that implements Iterator must be specified", 0 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } intern->ce_get_iterator = *pce_get_iterator; @@ -1007,7 +1004,6 @@ SPL_METHOD(Array, __construct) spl_array_set_array(object, intern, array, ar_flags, ZEND_NUM_ARGS() == 1 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ @@ -1022,13 +1018,11 @@ SPL_METHOD(Array, setIteratorClass) zend_class_entry ** pce_get_iterator; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &class_name, &class_name_len) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } if (zend_lookup_class(class_name, class_name_len, &pce_get_iterator TSRMLS_CC) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, "A class that implements Iterator must be specified", 0 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } intern->ce_get_iterator = *pce_get_iterator; |