<p>I have a class which has a private member <code>$content</code>. This is wrapped by a get-method:</p>

<pre><code>class ContentHolder
{
    private $content;
    public function __construct()
    {
        $this-&gt;content = "";
    }

    public function getContent()
    {
        return $this-&gt;content;
    }
}
$c = new ContentHolder();
$foo = array();
$foo['c'] = $c-&gt;getContent();
</code></pre>

<p>Now <code>$foo['c']</code> is a reference to <code>content</code>, which is what I don't understand. How can I get the value? Thank You in advance.</p>

In PHP, you don't say: "
```
$foo = new array();
```
"
Instead, you simply say: "
```
$foo = array();
```
"
I ran your code (PHP 5.2.6) and it seems to work fine.  I tested it by dumping the array:
```
```
var_dump($foo);
```
```
This outputs:
```
```
array(1) {
  ["c"]=>
  string(0) ""
}
```
```
I can also simple use
```
echo
```
:
```
```
echo "foo[c] = '" . $foo['c'] . "'\n";
```
```
This outputs:
```
```
foo[c] = ''
```
```