class myClass {
final function myFunction() {
echo "Parent";
}
}
// ERROR because a final method cannot be overridden in child classes.
class myClass2 extends myClass {
function myFunction() {
echo "Child";
}
}
The above code will generate the following error:Fatal error: Cannot override final method myClass::myFunction() in /home/user/scripts/code.php on line 9