Method overriding means that you can redefine a base class method in a derived class. overriding is process of modifying the inherited method. So in case of inheritance you only need to create method with same name in your child class which you want to override.
Overriding means having two methods with the same arguments, but different implementation
Method Overriding Example:
<?php
class Online {
function freeonlinetest() {
echo "Parent";
}
}
class Test extends Online {
function freeonlinetest() {
echo "Child";
}
}
$O = new Online;
$T= new Test;
$O->freeonlinetest();
$T->freeonlinetest();
//Output
Parent
Child
?>