fix bug #14218 Class' extending HttpMessage properties not accessible
[m6w6/ext-http] / tests / HttpMessage_002.phpt
1 --TEST--
2 HttpMessage properties
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkmin("5.2.5");
7 checkcls('HttpMessage');
8 ?>
9 --FILE--
10 <?php
11 class Message extends HttpMessage
12 {
13 var $var_property = 'var';
14 public $public_property = 'public';
15 protected $protected_property = 'protected';
16 private $private_property = 'private';
17
18 public function test()
19 {
20 var_dump($this->var_property);
21 var_dump($this->public_property);
22 var_dump($this->protected_property);
23 var_dump($this->private_property);
24 var_dump($this->non_ex_property);
25 $this->var_property.='_property';
26 $this->public_property.='_property';
27 $this->protected_property.='_property';
28 $this->private_property.='_property';
29 $this->non_ex_property = 'non_ex';
30 var_dump($this->var_property);
31 var_dump($this->public_property);
32 var_dump($this->protected_property);
33 var_dump($this->private_property);
34 var_dump($this->non_ex_property);
35
36 print_r($this->headers);
37 $this->headers['Foo'] = 'Bar';
38 }
39 }
40
41 error_reporting(E_ALL|E_STRICT);
42
43 echo "-TEST\n";
44 $m = new Message;
45 $m->test();
46 echo "Done\n";
47 ?>
48 --EXPECTF--
49 %aTEST
50 string(3) "var"
51 string(6) "public"
52 string(9) "protected"
53 string(7) "private"
54
55 Notice: Undefined property: Message::$non_ex_property in %s
56 NULL
57 string(12) "var_property"
58 string(15) "public_property"
59 string(18) "protected_property"
60 string(16) "private_property"
61 string(6) "non_ex"
62 Array
63 (
64 )
65 %aFatal error%sCannot access HttpMessage properties by reference or array key/index in%s