abstract class AbstractClass
{
// Force Extending class to define this method
abstract protected function getValue();
abstract protected function prefixValue($prefix);
// Common method
public function printOut() {
print $this->getValue() . "\n";
}
}
About abstract class:
Classes defined as abstract cannot be instantiated
Any class that contains at least one abstract method must also be abstract
Methods defined as abstract simply declare the method's signature - they cannot define the implementation