5 cent,
The most common example I see for this is when you have say a program with 3 similar objects. Let's say they are bicycles. Hence:
Class Bicycle {
function Move() {
Move at $this->speed;
}
function Stop() {
$this->speed = 0;
}
function Wheelie() {
blah blah;
}
}
redBike = New Bicycle;
greenBike = New Bicycle;
blueBike = New Bicycle;
redBike.color = #FF0000;
greenBike.color = #00FF00;
blueBike.color = #0000FF;
redBike.speed = 42;
greenBike.speed = 52;
blueBike.speed = 89;
redBike.Move();
greenBike.Move();
blueBike.Move();
blueBike.Wheelie();
redBike.Stop();
greenBike.Wheelie();
The syntax isn't exact because I haven't ever had a need to use classes but I think you get the idea. When each object has it's own variables (color, speed) they can be used in the functions as $this->color or $this->speed, basically eliminating the need to pass variables.
Peace,
Tom