Merge branch 'PHP-5.4'

This commit is contained in:
Xinchen Hui 2012-08-12 21:00:01 +08:00
commit 253760bb6b
2 changed files with 28 additions and 2 deletions

23
Zend/tests/bug62763.phpt Normal file
View File

@ -0,0 +1,23 @@
--TEST--
Bug #62763 (register_shutdown_function and extending class)
--FILE--
<?php
class test1 {
public function __construct() {
register_shutdown_function(array($this, 'shutdown'));
}
public function shutdown() {
exit(__METHOD__);
}
}
class test2 extends test1 {
public function __destruct() {
exit (__METHOD__);
}
}
new test1;
new test2;
?>
--EXPECT--
test1::shutdowntest2::__destruct

View File

@ -5067,8 +5067,11 @@ void php_free_shutdown_functions(TSRMLS_D) /* {{{ */
zend_hash_destroy(BG(user_shutdown_function_names));
FREE_HASHTABLE(BG(user_shutdown_function_names));
BG(user_shutdown_function_names) = NULL;
}
zend_end_try();
} zend_catch {
/* maybe shutdown method call exit, we just ignore it */
FREE_HASHTABLE(BG(user_shutdown_function_names));
BG(user_shutdown_function_names) = NULL;
} zend_end_try();
}
/* }}} */