Declaring Final Classes and Methods : final « Class « PHP






Declaring Final Classes and Methods

 
<?php
     final class NoExtending {
          public function myFunction() {
          }
     }
     class restrictedExtending {
          final public function anotherFunc() {
          }
     }
     class myChild extends restrictedExtending {
          public function thirdFunction() {
          }
     }
?>
  
  








Related examples in the same category

1.final class
2.Final Methods
3.final keyword can be used to declare a class uninheritable
4.The final keyword is used to declare that a method or class cannot be overridden by a subclass