cvs: ZendEngine2 / zend_builtin_functions.c

From: Date: Sun, 23 May 2004 20:27:33 +0000
Subject: cvs: ZendEngine2 / zend_builtin_functions.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2657@lists.php.net to get a copy of this message
andi Sun May 23 16:27:33 2004 EDT Modified files: /ZendEngine2 zend_builtin_functions.c Log: - Fix the following script (it crashed): <?php class ErrorHandler { function __construct() { set_error_handler(array(&$this, 'handle')); } function __destruct() { restore_error_handler(); } function handle($code, $msg, $file, $line, $locals) { } } new ErrorHandler(); ?> http://cvs.php.net/diff.php/ZendEngine2/zend_builtin_functions.c?r1=1.235&r2=1.236&ty=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.235 ZendEngine2/zend_builtin_functions.c:1.236 --- ZendEngine2/zend_builtin_functions.c:1.235 Tue Apr 27 14:09:40 2004 +++ ZendEngine2/zend_builtin_functions.c Sun May 23 16:27:32 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_builtin_functions.c,v 1.235 2004/04/27 18:09:40 helly Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.236 2004/05/23 20:27:32 andi Exp $ */ #include "zend.h" #include "zend_API.h" @@ -1005,8 +1005,12 @@ ZEND_FUNCTION(restore_error_handler) { if (EG(user_error_handler)) { - zval_ptr_dtor(&EG(user_error_handler)); + zval *zeh = EG(user_error_handler); + + EG(user_error_handler) = NULL; + zval_ptr_dtor(&zeh); } + if (zend_ptr_stack_num_elements(&EG(user_error_handlers))==0) { EG(user_error_handler) = NULL; } else {

« previous php.zend-engine.cvs (#2657) next »