summaryrefslogtreecommitdiff
path: root/Zend/tests/get_class_vars_006.phpt
blob: d1c2844aeba57e56715abd82bdfe252667baea35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
--TEST--
get_class_vars(): Testing visibility
--FILE--
<?php

class A {
	protected $a = 1;
}

class B extends A { }

class C extends B { }

var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
var_dump(get_class_vars('C'));

print "---\n";

class D extends B {
	public function __construct() {
		var_dump(get_class_vars('A'));
		var_dump(get_class_vars('B'));
		var_dump(get_class_vars('C'));		
	}
}

new D;

?>
--EXPECT--
array(0) {
}
array(0) {
}
array(0) {
}
---
array(1) {
  ["a"]=>
  int(1)
}
array(1) {
  ["a"]=>
  int(1)
}
array(1) {
  ["a"]=>
  int(1)
}