How can the use of the parent:: keyword in PHP help in accessing methods from parent classes and what are the best practices for its implementation?

When working with inheritance in PHP, the parent:: keyword is used to access methods from the parent class within a child class. This allows for reusing and extending functionality without duplicating code. It is important to use the parent:: keyword correctly to ensure that the appropriate method is called from the parent class.

class ParentClass {
    public function parentMethod() {
        echo "Parent method called";
    }
}

class ChildClass extends ParentClass {
    public function childMethod() {
        parent::parentMethod();
        echo "Child method called";
    }
}

$child = new ChildClass();
$child->childMethod();