In PHP, what are the key differences between using properties as variables and methods as functions, and how can these distinctions impact code functionality and structure?

When using properties as variables in PHP, you are accessing and setting values directly on an object. On the other hand, methods as functions allow you to encapsulate logic and behavior within the object. The key difference is that properties represent the state of an object, while methods define the behavior. Understanding this distinction is crucial for designing well-structured and maintainable code.

<?php
class Person {
    public $name; // property

    public function greet() { // method
        return "Hello, my name is " . $this->name;
    }
}

$person = new Person();
$person->name = "John Doe";
echo $person->greet();
?>