HI friends here I have share my code. I am used the Nested class in this Program. When I run this code it shows the Error like this. "syntax error, unexpected T_CLASS, expecting T_FUNCTION"
class Nest
{
class Display
{
private $s;
public sum($a, $b)
{
$s =$a+$b;
}
function show()
{
echo "Sum of a and b is:: ". $s;
}
}
}
new $x = Nest::Display;
$x->sum(12, 10);
$x->show();
I don't know what mistake i did. Any one help to solve this problem.