PHP class with single variable
<p>I'm using this PHP code for creating PHP class with default single variable.
But it's not work perfectly.</p>

<p><code>Note</code> : I need to store data in single variable.</p>

<pre><code>&lt;?PHP

class hello
{
    public $data;
}

$test = new hello();

$test-&gt;data-&gt;user1-&gt;name = "Charan";
$test-&gt;data-&gt;user1-&gt;sex  = "male";
$test-&gt;data-&gt;user1-&gt;age  = "25";

$test-&gt;data-&gt;user2-&gt;name = "Kajal";
$test-&gt;data-&gt;user2-&gt;sex  = "female";
$test-&gt;data-&gt;user2-&gt;age  = "21";


print_r($test-&gt;data-&gt;user1);


?&gt;
</code></pre>

<p>I got this error :</p>

<p><img src="http://i.stack.imgur.com/JvZZS.png" alt="enter image description here"></p>

<p>Please help me , how to fix it ?</p>
