I'm trying to learn OOP in PHP. What stumps me is understanding just WHAT AN OBJECT IS and how to tell when I'm looking at one. I'm probably very wrong, but here's how I seem to be getting it so far.
Properties are variables inside a class/method. Methods are functions inside a class.
And objects are..... well..... That's exactly where I'm lost. But, as far as I get it (IF I'M GETTING IT), an object is the combination of those properties and methods
So, if
class person {
var $name;
function set_name($new_name) {
$this->name = $new_name;
}
function get_name() {
return $this->name;
}
}
The class is person the property is $name the method is set_name()
AND WILL THE OBJECT BE SOMETHING LIKE
$person_id = new person();?
Now, if I got EVERYTHING wrong, lol.