hiphop-php /hphp/test/zend/bad/ext/reflection/tests/ReflectionClass_getDefaultProperties_001.php

Language PHP Lines 70
MD5 Hash 67a4b6e282a74309d472a337f3c33320 Estimated Cost $1,212 (why?)
Repository git://github.com/facebook/hiphop-php.git View Raw File View Project SPDX
 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php


class A {
	static public $statPubC = "stat pubC in A";
	static protected $statProtC = "stat protC in A";
	static private $statPrivC = "stat privC in A";
	
	static public $statPubA = "stat pubA in A";
	static protected $statProtA = "stat protA in A";
	static private $statPrivA = "stat privA in A";
	
	public $pubC = "pubC in A";
	protected $protC = "protC in A";
	private $privC = "privC in A";
	
	public $pubA = "pubA in A";
	protected $protA = "protA in A";
	private $privA = "privA in A";
}

class B extends A {
	static public $statPubC = "stat pubC in B";
	static protected $statProtC = "stat protC in B";
	static private $statPrivC = "stat privC in B";

	static public $statPubB = "stat pubB in B";
	static protected $statProtB = "stat protB in B";
	static private $statPrivB = "stat privB in B";	
	
	public $pubC = "pubC in B";
	protected $protC = "protC in B";
	private $privC = "privC in B";

	public $pubB = "pubB in B";
	protected $protB = "protB in B";
	private $privB = "privB in B";	
}

class C extends B {
	static public $statPubC = "stat pubC in C";
	static protected $statProtC = "stat protC in C";
	static private $statPrivC = "stat privC in C";
	
	public $pubC = "pubC in C";
	protected $protC = "protC in C";
	private $privC = "privC in C";
}

class X {
	static public $statPubC = "stat pubC in X";
	static protected $statProtC = "stat protC in X";
	static private $statPrivC = "stat privC in X";

	public $pubC = "pubC in X";
	protected $protC = "protC in X";
	private $privC = "privC in X";	
}

$classes = array('A', 'B', 'C', 'X');
foreach ($classes as $class) {
	$rc = new ReflectionClass($class);
	echo "\n\n---- Static properties in $class ----\n";
	print_r($rc->getStaticProperties());
	echo "\n\n---- Default properties in $class ----\n";	
	print_r($rc->getDefaultProperties());
}

?>
Back to Top