I can't understand what is the specialty of & while naming a function. I am not good enough in OOP of PHP.
[PHP]class FirstClass{
function &FunctionName($ Para)
{
return $Para; //Or any other operation
}
}
class SecondClass{
function FunctionName($P ara)
{
return $Para; //Or any other operation
}
}
$UseClass = &FirstClass::Fu nctionName(10);
echo $UseClass;
$UseSecondClass = SecondClass::Fu nctionName(10);
echo $UseSecondClass ;
[/PHP]
Output are same for both classes.
[PHP]class FirstClass{
function &FunctionName($ Para)
{
return $Para; //Or any other operation
}
}
class SecondClass{
function FunctionName($P ara)
{
return $Para; //Or any other operation
}
}
$UseClass = &FirstClass::Fu nctionName(10);
echo $UseClass;
$UseSecondClass = SecondClass::Fu nctionName(10);
echo $UseSecondClass ;
[/PHP]
Output are same for both classes.
Comment