diff options
| author | Xinchen Hui <laruence@php.net> | 2012-08-12 21:00:01 +0800 |
|---|---|---|
| committer | Xinchen Hui <laruence@php.net> | 2012-08-12 21:00:01 +0800 |
| commit | 253760bb6b73ad39ec1143aad4ecc95ee281dc7b (patch) | |
| tree | eb66ecc1cd975d627958a43a45a1f5da893bae7d | |
| parent | 9787e7af44096dec749bcb1f71dbf6e9d75e1de5 (diff) | |
| parent | be818e7ea7a7627ab12faa70d9e70a85c823f738 (diff) | |
| download | php-git-253760bb6b73ad39ec1143aad4ecc95ee281dc7b.tar.gz | |
Merge branch 'PHP-5.4'
| -rw-r--r-- | Zend/tests/bug62763.phpt | 23 | ||||
| -rw-r--r-- | ext/standard/basic_functions.c | 7 |
2 files changed, 28 insertions, 2 deletions
diff --git a/Zend/tests/bug62763.phpt b/Zend/tests/bug62763.phpt new file mode 100644 index 0000000000..50c27bdf35 --- /dev/null +++ b/Zend/tests/bug62763.phpt @@ -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 diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index b97c22c4ff..a2d236c9df 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -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(); } /* }}} */ |
