title: Can I get the value of a private property with Reflection?
body: <p>It doesn't seem to work:</p>
  
  <pre><code>$ref = new ReflectionObject($obj);
  
  if($ref-&gt;hasProperty('privateProperty')){
    print_r($ref-&gt;getProperty('privateProperty'));
  }
  </code></pre>
  
  <p>It gets into the IF loop, and then throws an error:</p>
  
  <blockquote>
    <p>Property privateProperty does not exist</p>
  </blockquote>
  
  <p>:|</p>
  
  <p><code>$ref = new ReflectionProperty($obj, 'privateProperty')</code> doesn't work either...</p>
  
  <p>The <a href="http://www.php.net/manual/en/class.reflectionproperty.php">documentation page</a> lists a few constants, including <code>IS_PRIVATE</code>. How can I ever use that if I can't access a private property lol?</p>