Confused about the use of return in PHP functions ..... 10 points for a good answer?

Boogyman

New member
When should I use return in my functions ??? In the get function , return is used , but set function , return is not ... when should I use the return statement in functions ??? would it be illegal if I used it in the SET FUNCTION ???


The __get function for example will be like this :

function__get($name)

{

return $this->$name;
}

and the __set function will be like this

function__set($name,$value)
{
$this->$name = $value;

}
 
Back
Top