How does static keyword in PHP OOP help in accessing parent class variables?

When accessing parent class variables in PHP OOP, the static keyword can be used to access these variables without needing an instance of the parent class. This is useful when you want to access variables or methods from a parent class without creating an instance of it.

class ParentClass {
    public static $parentVar = "I am a parent variable";
}

class ChildClass extends ParentClass {
    public function getParentVar() {
        return parent::$parentVar;
    }
}

$child = new ChildClass();
echo $child->getParentVar(); // Output: I am a parent variable