File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,10 @@ static HashTable* spl_fixedarray_object_get_properties(zend_object *obj)
214
214
if (!spl_fixedarray_empty (& intern -> array )) {
215
215
zend_long j = zend_hash_num_elements (ht );
216
216
217
+ if (GC_REFCOUNT (ht ) > 1 ) {
218
+ intern -> std .properties = zend_array_dup (ht );
219
+ GC_TRY_DELREF (ht );
220
+ }
217
221
for (zend_long i = 0 ; i < intern -> array .size ; i ++ ) {
218
222
zend_hash_index_update (ht , i , & intern -> array .elements [i ]);
219
223
Z_TRY_ADDREF (intern -> array .elements [i ]);
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ SPL: FixedArray: Bug GH-8044 (var_export/debug_zval_dump HT_ASSERT_RC1 debug failure for SplFixedArray)
3
+ --FILE--
4
+ <?php
5
+ call_user_func (function () {
6
+ $ x = new SplFixedArray (1 );
7
+ $ x [0 ] = $ x ;
8
+ var_export ($ x ); echo "\n" ;
9
+ debug_zval_dump ($ x ); echo "\n" ;
10
+ });
11
+ ?>
12
+ --EXPECTF--
13
+ Warning: var_export does not handle circular references in %s on line 5
14
+ SplFixedArray::__set_state(array(
15
+ 0 => NULL,
16
+ ))
17
+ object(SplFixedArray)#2 (1) refcount(4){
18
+ [0]=>
19
+ *RECURSION*
20
+ }
You can’t perform that action at this time.
0 commit comments