$this->foobar = 2;
$this->a = 200;
- $p = new reflectionproperty($this, 'a');
- $p->setAccessible(true);
- var_dump($p->getValue($this), $p->isDefault(), $p->isPublic());
-
$p = new reflectionproperty($this, 'foobar');
var_dump($p->getValue($this), $p->isDefault(), $p->isPublic());
}
new bar;
?>
+===DONE===
--EXPECTF--
-object(ReflectionProperty)#2 (2) {
+object(ReflectionProperty)#%d (2) {
["name"]=>
string(1) "z"
["class"]=>
int(1000)
---------------------------
string(30) "Property x::$zz does not exist"
-object(ReflectionProperty)#3 (2) {
+object(ReflectionProperty)#%d (2) {
["name"]=>
string(3) "zzz"
["class"]=>
string(1) "x"
}
-int(200)
-bool(true)
-bool(false)
int(2)
bool(false)
bool(true)
+===DONE===
new test;
?>
---EXPECT--
-object(ReflectionProperty)#3 (2) {
+===DONE===
+--EXPECTF--
+object(ReflectionProperty)#%d (2) {
["name"]=>
string(4) "test"
["class"]=>
string(3) "foo"
}
-object(ReflectionProperty)#5 (2) {
+object(ReflectionProperty)#%d (2) {
["name"]=>
string(1) "a"
["class"]=>
bool(false)
array(2) {
[0]=>
- &object(ReflectionProperty)#6 (2) {
+ &object(ReflectionProperty)#%d (2) {
["name"]=>
string(1) "b"
["class"]=>
string(4) "test"
}
[1]=>
- &object(ReflectionProperty)#7 (2) {
+ &object(ReflectionProperty)#%d (2) {
["name"]=>
string(1) "a"
["class"]=>
string(4) "test"
}
}
+===DONE===
\ No newline at end of file