File tree 2 files changed +19
-1
lines changed 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Exception during WeakMap destruction during shutdown
3
+ --FILE--
4
+ <?php
5
+ $ map = new WeakMap ;
6
+ $ obj = new stdClass ;
7
+ $ map [$ obj ] = new class {
8
+ function __destruct () {
9
+ throw new Exception ("Test " );
10
+ }
11
+ };
12
+ ?>
13
+ --EXPECTF--
14
+ Fatal error: Uncaught Exception: Test in %s:%d
15
+ Stack trace:
16
+ #0 [internal function]: class@anonymous->__destruct()
17
+ #1 {main}
18
+ thrown in %s on line %d
Original file line number Diff line number Diff line change @@ -157,8 +157,8 @@ void zend_weakrefs_notify(zend_object *object) {
157
157
ZEND_ASSERT (tagged_ptr && "Tracking of the IS_OBJ_WEAKLY_REFERENCE flag should be precise" );
158
158
#endif
159
159
if (tagged_ptr ) {
160
- zend_weakref_unref (obj_addr , tagged_ptr );
161
160
zend_hash_index_del (& EG (weakrefs ), obj_addr );
161
+ zend_weakref_unref (obj_addr , tagged_ptr );
162
162
}
163
163
}
164
164
You can’t perform that action at this time.
0 commit comments