Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php

<?php
class BaseClass {
   public function test() {
       echo "BaseClass::test() called
";
   }
   
   final public function moreTesting() {
       echo "BaseClass::moreTesting() called
";
   }
}

class ChildClass extends BaseClass {
   public function moreTesting() {
       echo "ChildClass::moreTesting() called
";
   }
}
// Results in Fatal error: Cannot override final method BaseClass::moreTesting()
?>
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #php
ADD COMMENT
Topic
Name
3+5 =