save funccall
[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 test() {
12 $this->headers["bykey"] = 1;
13 var_dump($this->headers);
14
15 $h = &$this->headers;
16 $h["by1ref"] = 2;
17 var_dump($this->headers);
18
19 $x = &$this->headers["byXref"];
20
21 $h = &$this->headers["by2ref"];
22 $h = 1;
23 var_dump($this->headers);
24
25 $x = 2;
26 var_dump($this->headers);
27
28 $this->headers["bynext"][] = 1;
29 $this->headers["bynext"][] = 2;
30 $this->headers["bynext"][] = 3;
31 var_dump($this->headers);
32 }
33 }
34
35 $m=new m;
36 $m->test();
37 echo $m,"\n";
38
39 ?>
40 DONE
41 --EXPECTF--
42 array(1) {
43 ["bykey"]=>
44 int(1)
45 }
46 array(2) {
47 ["bykey"]=>
48 int(1)
49 ["by1ref"]=>
50 int(2)
51 }
52 array(3) {
53 ["bykey"]=>
54 int(1)
55 ["by1ref"]=>
56 int(2)
57 ["by2ref"]=>
58 &int(1)
59 }
60 array(4) {
61 ["bykey"]=>
62 int(1)
63 ["by1ref"]=>
64 int(2)
65 ["by2ref"]=>
66 &int(1)
67 ["byXref"]=>
68 &int(2)
69 }
70 array(5) {
71 ["bykey"]=>
72 int(1)
73 ["by1ref"]=>
74 int(2)
75 ["by2ref"]=>
76 &int(1)
77 ["byXref"]=>
78 &int(2)
79 ["bynext"]=>
80 array(3) {
81 [0]=>
82 int(1)
83 [1]=>
84 int(2)
85 [2]=>
86 int(3)
87 }
88 }
89 bykey: 1
90 by1ref: 2
91 by2ref: 1
92 byXref: 2
93 bynext: 1, 2, 3
94
95 DONE
96