Hello there
I am wondering if php methods are ever defined outside of the class body as they are often done in C++. I realise this question is the same as http://stackoverflow.com/questions/71478/defining-class-methods-in-php . But I believe his original question had 'declare' instead of 'define' so all the answers seem a bit inappropriate.
Thanks
Zenna
Update
Probably my idea of define and declare were flawed. But by define outside of the class body, i meant something equivalent to the C++
class CRectangle {
int x, y;
public:
void set_values (int,int);
int area () {return (x*y);}
};
void CRectangle::set_values (int a, int b) {
x = a;
y = b;
}
All the examples of php code have the the code inside the class body like a C++ inlined function. Even if there would be no functional difference between the two in PHP, its just a question of style.