Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_3) / zend.h zend_API.c zend_globals.h

[email protected] (Antony Dovgal)
Newsgroups php.zend-engine.cvs
Message-ID <[email protected]>
On 11.08.2008 21:19, Marcus Boerger wrote:
> -ZEND_API void zend_restore_error_handling(const zend_error_handling *saved TSRMLS_DC) /* {{{ */
> +ZEND_API void zend_restore_error_handling(zend_error_handling *saved TSRMLS_DC) /* {{{ */
>  {
>  	EG(error_handling) = saved->handling;
>  	EG(exception_class) = saved->handling == EH_THROW ? saved->exception : NULL;
> +	if (saved->user_handler	&& saved->user_handler != EG(user_error_handler)) {
> +		if (EG(user_error_handler)) {
> +			zval_ptr_dtor(&EG(user_error_handler));
> +		}
> +		EG(user_error_handler) = saved->user_handler;
> +	} else if (saved->user_handler) {
> +		zval_ptr_dtor(&saved->user_handler);
> +	}
> +	saved->user_handler = NULL;
>  }

This breaks restore_error_handler():
# php -r 'function foo() { var_dump(__FUNCTION__); } set_error_handler("foo"); restore_error_handler(); trigger_error("foobar", E_USER_ERROR);'
string(3) "foo"

-- 
Wbr, 
Antony Dovgal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.