File tree 3 files changed +59
-5
lines changed 3 files changed +59
-5
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,9 @@ PHP NEWS
2
2
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3
3
?? ??? 2016 PHP 7.0.3
4
4
5
- - Apache2handler:
6
- . Fix >2G Content-Length headers in apache2handler. (Adam Harvey)
7
-
8
5
- Core:
6
+ . Fixed bug #71336 (Wrong is_ref on properties as exposed via
7
+ get_object_vars()). (Laruence)
9
8
. Fixed bug #71248 (Wrong interface is enforced). (Dmitry)
10
9
. Fixed bug #71300 (Segfault in zend_fetch_string_offset). (Laruence)
11
10
. Fixed bug #71221 (Null pointer deref (segfault) in get_defined_vars via
@@ -19,6 +18,9 @@ PHP NEWS
19
18
. Fixed bug #71297 (Memory leak with consecutive yield from). (Bob)
20
19
. Fixed bug #71314 (var_export(INF) prints INF.0). (Andrea)
21
20
21
+ - Apache2handler:
22
+ . Fix >2G Content-Length headers in apache2handler. (Adam Harvey)
23
+
22
24
- CURL:
23
25
. Fixed bug #71227 (Can't compile php_curl statically). (Anatol)
24
26
. Fixed bug #71225 (curl_setopt() fails to set CURLOPT_POSTFIELDS with
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #71336 (Wrong is_ref on properties as exposed via get_object_vars())
3
+ --FILE--
4
+ <?php
5
+ class A
6
+ {
7
+ protected $ bar = array ('baz ' );
8
+
9
+ function bar ()
10
+ {
11
+ array_pop ($ this ->bar );
12
+ $ vars = get_object_vars ($ this );
13
+ $ this ->bar [] = array ('buz ' );
14
+ print_r ($ vars );
15
+ }
16
+
17
+ function foo () {
18
+ array_pop ($ this ->bar );
19
+ $ dummy = &$ this ->bar ;
20
+ $ vars = get_object_vars ($ this );
21
+ $ this ->bar [] = array ('buz ' );
22
+ print_r ($ vars );
23
+ }
24
+ }
25
+
26
+ (new A ())->bar ();
27
+ (new A ())->foo ();
28
+ ?>
29
+ --EXPECT--
30
+ Array
31
+ (
32
+ [bar] => Array
33
+ (
34
+ )
35
+
36
+ )
37
+ Array
38
+ (
39
+ [bar] => Array
40
+ (
41
+ [0] => Array
42
+ (
43
+ [0] => buz
44
+ )
45
+
46
+ )
47
+
48
+ )
Original file line number Diff line number Diff line change @@ -1198,8 +1198,12 @@ ZEND_FUNCTION(get_object_vars)
1198
1198
ZEND_HASH_FOREACH_STR_KEY_VAL_IND (properties , key , value ) {
1199
1199
if (key ) {
1200
1200
if (zend_check_property_access (zobj , key ) == SUCCESS ) {
1201
- /* Not separating references */
1202
- if (Z_REFCOUNTED_P (value )) Z_ADDREF_P (value );
1201
+ if (Z_ISREF_P (value ) && Z_REFCOUNT_P (value ) == 1 ) {
1202
+ value = Z_REFVAL_P (value );
1203
+ }
1204
+ if (Z_REFCOUNTED_P (value )) {
1205
+ Z_ADDREF_P (value );
1206
+ }
1203
1207
if (ZSTR_VAL (key )[0 ] == 0 ) {
1204
1208
const char * prop_name , * class_name ;
1205
1209
size_t prop_len ;
You can’t perform that action at this time.
0 commit comments