if you have your class set up like this:
class functions {
var $x;
var $y;
var $result;
function set_x($value) {
$this->x = $value;
}
function set_y($value) {
$this->y = $value;
}
function add() {
$this->result = $this->x + $this->y;
}
function functions($x_value, $y_value) {
$this->set_x($x_value);
$this->set_y($y_value);
$this->add();
}
}
When you initialize your object with
$functions = new functions($x_value, $y_value); it will automatically run your constructor (the function with the same name as the class). If you don't want this to happen, rename your constructor, so that it has a different name, and call your functions like this:
$functions->set_x($x_value);
$functions->add();