File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #62763 (register_shutdown_function and extending class)
3
+ --FILE--
4
+ <?php
5
+ class test1 {
6
+ public function __construct () {
7
+ register_shutdown_function (array ($ this , 'shutdown ' ));
8
+ }
9
+ public function shutdown () {
10
+ exit (__METHOD__ );
11
+ }
12
+ }
13
+
14
+ class test2 extends test1 {
15
+ public function __destruct () {
16
+ exit (__METHOD__ );
17
+ }
18
+ }
19
+ new test1 ;
20
+ new test2 ;
21
+ ?>
22
+ --EXPECT--
23
+ test1::shutdowntest2::__destruct
Original file line number Diff line number Diff line change @@ -5067,8 +5067,11 @@ void php_free_shutdown_functions(TSRMLS_D) /* {{{ */
5067
5067
zend_hash_destroy (BG (user_shutdown_function_names ));
5068
5068
FREE_HASHTABLE (BG (user_shutdown_function_names ));
5069
5069
BG (user_shutdown_function_names ) = NULL ;
5070
- }
5071
- zend_end_try ();
5070
+ } zend_catch {
5071
+ /* maybe shutdown method call exit, we just ignore it */
5072
+ FREE_HASHTABLE (BG (user_shutdown_function_names ));
5073
+ BG (user_shutdown_function_names ) = NULL ;
5074
+ } zend_end_try ();
5072
5075
}
5073
5076
/* }}} */
5074
5077
You can’t perform that action at this time.
0 commit comments