What is the correct syntax for accessing class properties within a class in PHP?

To access class properties within a class in PHP, you need to use the $this keyword followed by the arrow operator (->) and then the property name. This syntax allows you to refer to the specific instance of the class and access its properties. Make sure to use $this->propertyName to access class properties from within the class methods.

class MyClass {
    public $property;

    public function getProperty() {
        return $this->property;
    }
}