Q:

What does RETURN TRUE do in a php function?

I was just looking at this code and i don't understand what RETURN TRUE does or what the point of it is? Can someone please explain?
class Elephpant {

    public $colour;

    public function dance() {
        echo "elephpant dances!\n";
        return true;
    }
}

Thankyou in advance ;-)

A:

It returns the boolean TRUE to whatever called dance(). That's all.
You would have to look at the consuming code to see if it makes something from it.

A:

In that specific piece of code - not very much.
In general however it would be used to return a condition of a validation or code that needs to return either a positive or a negative.
For instance, one would do the following:
public function isValidEmail($email) {
    // do work to see if email is valid
    if(/* Condition making it true */)
       return true;
    else
       return false;
}

