Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The <code>:private</code> part of the var_dump output isn't actually part of the member name, it's an indicator that the <code>_aVars</code> member is <a href="http://php.net/private" rel="nofollow noreferrer">private</a>.</p> <p>Because <code>_aVars</code> is private, it's value cannot be accessed from outside of the object, only from inside.</p> <p>You'd need a public getter function or something similar in order to retrieve the value.</p> <p><strong>Edit</strong></p> <p>To help clarify this, I made an example:</p> <pre><code>class testClass { public $x = 10; private $y = 0; } $obj = new testClass(); echo "Object: "; var_dump($obj); echo "Public property:"; var_dump($obj-&gt;x); echo "Private property:"; var_dump($obj-&gt;y); </code></pre> <p>The above code produces the following output:</p> <pre><code>Object: object(testClass)[1] public 'x' =&gt; int 10 private 'y' =&gt; int 0 Public property: int 10 Private property: </code></pre> <p>Notice how nothing comes after the attempted <code>var_dump()</code> of the private variable. Since the code doesn't have access to <code>$obj-&gt;y</code> from outside, that means that <code>var_dump()</code> cannot access it to produce any information about it.</p> <p>Since <code>$obj</code> is a local variable however, <code>var_dump()</code> works fine there. It's a specific characteristic of <code>var_dump()</code> that it will output information about protected and private object member variables, so that's why you see it in the object dump. It doesn't mean that you have access to them however.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload