What are the best practices for accessing object properties in different PHP files?

When accessing object properties in different PHP files, it is best practice to use getters and setters to encapsulate the property access. This helps maintain data integrity and allows for easier debugging and modification of the code in the future.

// File: User.php
class User {
    private $name;

    public function getName() {
        return $this->name;
    }

    public function setName($name) {
        $this->name = $name;
    }
}
```

```php
// File: index.php
include 'User.php';

$user = new User();
$user->setName('John Doe');

echo $user->getName(); // Output: John Doe