<?php
class roxy
{
function sam()
{
$name;
$class;
$age;
echo $name;
echo $class;
echo $age;
}
}
$kush= new roxy();
$kush->name="sachin";
$kush->class=12;
$kush->age=21;
$kush->sam();
?>
Here variables are declared localy and when value of variables set through object and after that i call the function it shows me undefined in the result screen.