What are the differences between using 'var' and 'public/private/protected' in PHP classes?

When defining properties in PHP classes, using 'var' is considered outdated and not recommended. It is better to explicitly declare the visibility of properties using 'public', 'private', or 'protected'. This helps improve code readability and maintainability by clearly indicating the intended access level of each property.

class MyClass {
    public $publicProperty;
    private $privateProperty;
    protected $protectedProperty;
}