diff options
author | Marcus Boerger <helly@php.net> | 2008-07-13 21:42:49 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2008-07-13 21:42:49 +0000 |
commit | 2bf3bfc746f0f034ef9c443ae697b0c3f4b5d3dc (patch) | |
tree | d6fd38b7a2043f56906e1f10de7b445c13e6668a /Zend/zend_objects.c | |
parent | 805f552cd3e0be81a254f27abba64f27140f9c66 (diff) | |
download | php-git-2bf3bfc746f0f034ef9c443ae697b0c3f4b5d3dc.tar.gz |
- MFH Exception handling
[DOC]
- Exceptions can be thrown while exceptions are pending, they are linked
- Exceptions can be handled in __destruct
- Add optional Exception $previous parameter to
. Exception::__construct
. ErrorException::__construct
Diffstat (limited to 'Zend/zend_objects.c')
-rw-r--r-- | Zend/zend_objects.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index 3dcc15eaaf..4814005693 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -99,20 +99,7 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl old_exception = EG(exception); EG(exception) = NULL; zend_call_method_with_0_params(&obj, object->ce, &destructor, ZEND_DESTRUCTOR_FUNC_NAME, NULL); - if (old_exception) { - if (EG(exception)) { - zend_class_entry *default_exception_ce = zend_exception_get_default(TSRMLS_C); - zval *file = zend_read_property(default_exception_ce, old_exception, "file", sizeof("file")-1, 1 TSRMLS_CC); - zval *line = zend_read_property(default_exception_ce, old_exception, "line", sizeof("line")-1, 1 TSRMLS_CC); - - zval_ptr_dtor(&obj); - zval_ptr_dtor(&EG(exception)); - EG(exception) = old_exception; - zend_error(E_ERROR, "Ignoring exception from %s::__destruct() while an exception is already active (Uncaught %s in %s on line %ld)", - object->ce->name, Z_OBJCE_P(old_exception)->name, Z_STRVAL_P(file), Z_LVAL_P(line)); - } - EG(exception) = old_exception; - } + zend_exception_set_previous(old_exception TSRMLS_CC); zval_ptr_dtor(&obj); } } |