예제 #1
0
파일: bug46064.php 프로젝트: badlamer/hhvm
 public function __construct()
 {
     $this->foobar = 2;
     $this->a = 200;
     $p = new reflectionproperty($this, 'foobar');
     var_dump($p->getValue($this), $p->isDefault(), $p->isPublic());
 }
예제 #2
0
 public function setPrivateProperty($obj, $name, $value)
 {
     $property = new \reflectionproperty(get_class($obj), $name);
     $property->setAccessible(true);
     $property->setValue($obj, $value);
 }