title: How to get protected property of object in PHP
body: <p>I have a object having some protected property that I want to get and set. The object looks like</p>
  
  <pre><code>Fields_Form_Element_Location Object
  (
  [helper] =&gt; formText
  [_allowEmpty:protected] =&gt; 1
  [_autoInsertNotEmptyValidator:protected] =&gt; 1
  [_belongsTo:protected] =&gt; 
  
  
  [_description:protected] =&gt; 
  [_disableLoadDefaultDecorators:protected] =&gt; 
  [_errorMessages:protected] =&gt; Array
      (
      )
  
  [_errors:protected] =&gt; Array
      (
      )
  [_isErrorForced:protected] =&gt; 
  [_label:protected] =&gt; Current City
  
  
  [_value:protected] =&gt; 93399
  [class] =&gt; field_container field_19 option_1 parent_1
  )
  </code></pre>
  
  <p>I want to get <code>value</code> property of the object. When I try <code>$obj-&gt;_value</code> or <code>$obj-&gt;value</code> it generates error. I searched and found the solution to use <code>PHP Reflection Class</code>. It worked on my local but on server PHP version is <code>5.2.17</code> So I cannot use this function there. So any solution how to get such property?</p>