File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 4
4
- Fixed an error in mysqli_fetch_fields (returned NULL instead of an
5
5
array when row number > field_count). (Georg)
6
6
- Renamed CachingRecursiveIterator to RecursiveCachingIterator. (Marcus)
7
+ - Fixed bug #36006 (Problem with $this in __destruct()). (Dmitry)
7
8
- Fixed bug #35612 (iis6 Access Violation crash). (Dmitry, alacn.uhahaa)
8
9
- Fixed bug #35570 (segfault when re-using soap client object). (Dmitry)
9
10
- FIxed bug #35536 (mysql_field_type() doesn't handle NEWDECIMAL). (Tony)
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #36006 (Problem with $this in __destruct())
3
+ --FILE--
4
+ <?php
5
+
6
+ class Person {
7
+ public $ dad ;
8
+ public function __destruct () {
9
+ $ this ->dad = null ; /* no segfault if this is commented out */
10
+ }
11
+ }
12
+
13
+ class Dad extends Person {
14
+ public $ son ;
15
+ public function __construct () {
16
+ $ this ->son = new Person ;
17
+ $ this ->son ->dad = $ this ; /* no segfault if this is commented out */
18
+ }
19
+ public function __destruct () {
20
+ $ this ->son = null ;
21
+ parent ::__destruct (); /* segfault here */
22
+ }
23
+ }
24
+
25
+ $ o = new Dad ;
26
+ unset($ o );
27
+ echo "ok \n" ;
28
+ ?>
29
+ --EXPECT--
30
+ ok
Original file line number Diff line number Diff line change @@ -52,7 +52,9 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
52
52
if (!objects -> object_buckets [i ].destructor_called ) {
53
53
objects -> object_buckets [i ].destructor_called = 1 ;
54
54
if (obj -> dtor ) {
55
+ obj -> refcount ++ ;
55
56
obj -> dtor (obj -> object , i TSRMLS_CC );
57
+ obj -> refcount -- ;
56
58
}
57
59
}
58
60
}
You can’t perform that action at this time.
0 commit comments