Fix operator for Visual Studio
[m6w6/ext-http] / tests / propertyproxy001.phpt
1 --TEST--
2 property proxy
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9
10 class m extends http\Message {
11 function test1() {
12 $this->headers["bykey"] = 1;
13 var_dump($this->headers);
14 }
15 function test2() {
16 $h = &$this->headers;
17 $h["by1ref"] = 2;
18 var_dump($this->headers);
19 }
20 function test3() {
21 $x = &$this->headers["byXref"];
22
23 $h = &$this->headers["by2ref"];
24 $h = 1;
25 var_dump($this->headers);
26
27 $x = 2;
28 var_dump($this->headers);
29 }
30 function test4() {
31 $this->headers["bynext"][] = 1;
32 $this->headers["bynext"][] = 2;
33 $this->headers["bynext"][] = 3;
34 var_dump($this->headers);
35 }
36 }
37
38 $m=new m;
39 $m->test1();
40 $m->test2();
41 $m->test3();
42 $m->test4();
43 echo $m,"\n";
44
45 ?>
46 DONE
47 --EXPECTF--
48 array(1) {
49 ["bykey"]=>
50 int(1)
51 }
52 array(2) {
53 ["bykey"]=>
54 int(1)
55 ["by1ref"]=>
56 int(2)
57 }
58 array(3) {
59 ["bykey"]=>
60 int(1)
61 ["by1ref"]=>
62 int(2)
63 ["by2ref"]=>
64 int(1)
65 }
66 array(4) {
67 ["bykey"]=>
68 int(1)
69 ["by1ref"]=>
70 int(2)
71 ["by2ref"]=>
72 int(1)
73 ["byXref"]=>
74 int(2)
75 }
76 array(5) {
77 ["bykey"]=>
78 int(1)
79 ["by1ref"]=>
80 int(2)
81 ["by2ref"]=>
82 int(1)
83 ["byXref"]=>
84 int(2)
85 ["bynext"]=>
86 array(3) {
87 [0]=>
88 int(1)
89 [1]=>
90 int(2)
91 [2]=>
92 int(3)
93 }
94 }
95 bykey: 1
96 by1ref: 2
97 by2ref: 1
98 byXref: 2
99 bynext: 1
100 bynext: 2
101 bynext: 3
102
103 DONE
104