remo0ve semi-global PHP anntotation interfering with system values
[awesomized/ext-ion] / tests / serialize / backref.phpt
1 --TEST--
2 ion\serialize/backref
3 --EXTENSIONS--
4 ion
5 --FILE--
6 TEST
7 <?php
8 $a = "a";
9 $b = (object) [];
10 $c = [1,2,3];
11 $d = [$a, $a, $b, $b, $c, $c];
12 $e = [&$e];
13 $s = ion\serialize($e);
14 echo $s,"\n";
15 $x = ion\unserialize($s);
16 var_dump($x);
17
18 $f = [$e, $d, $d, $a, $b, $c];
19 $s = ion\serialize($f);
20 echo $s,"\n";
21 $x = ion\unserialize($s);
22 debug_zval_dump($x);
23 ?>
24 DONE
25 --EXPECTF--
26 TEST
27 [R::r::0]
28 array(1) {
29 [0]=>
30 *RECURSION*
31 }
32 [[R::r::1],["a",r::4,o::{},r::5,[1,2,3],r::6],r::3,r::4,r::5,r::6]
33 array(6) refcount(2){
34 [0]=>
35 array(1) refcount(2){
36 [0]=>
37 reference refcount(1) {
38 *RECURSION*
39 }
40 }
41 [1]=>
42 array(6) refcount(2){
43 [0]=>
44 string(1) "a" refcount(3)
45 [1]=>
46 string(1) "a" refcount(3)
47 [2]=>
48 object(stdClass)#%d (0) refcount(3){
49 }
50 [3]=>
51 object(stdClass)#%d (0) refcount(3){
52 }
53 [4]=>
54 array(3) refcount(3){
55 [0]=>
56 int(1)
57 [1]=>
58 int(2)
59 [2]=>
60 int(3)
61 }
62 [5]=>
63 array(3) refcount(3){
64 [0]=>
65 int(1)
66 [1]=>
67 int(2)
68 [2]=>
69 int(3)
70 }
71 }
72 [2]=>
73 array(6) refcount(2){
74 [0]=>
75 string(1) "a" refcount(3)
76 [1]=>
77 string(1) "a" refcount(3)
78 [2]=>
79 object(stdClass)#%d (0) refcount(3){
80 }
81 [3]=>
82 object(stdClass)#%d (0) refcount(3){
83 }
84 [4]=>
85 array(3) refcount(3){
86 [0]=>
87 int(1)
88 [1]=>
89 int(2)
90 [2]=>
91 int(3)
92 }
93 [5]=>
94 array(3) refcount(3){
95 [0]=>
96 int(1)
97 [1]=>
98 int(2)
99 [2]=>
100 int(3)
101 }
102 }
103 [3]=>
104 string(1) "a" refcount(3)
105 [4]=>
106 object(stdClass)#%d (0) refcount(3){
107 }
108 [5]=>
109 array(3) refcount(3){
110 [0]=>
111 int(1)
112 [1]=>
113 int(2)
114 [2]=>
115 int(3)
116 }
117 }
118 DONE