Final Keyword in PHP

In this tutorial, you will learn about final keyword and its uses in PHP.



If a class or method is declared with final can not be override or inherited by another class

Final Keyword Use to Protect the code like Access modifier (private and protected).  if you inherit a class having final keyword then it will throw you an error.

 

See the below example

 



Tags: ,