New Object Oriented Features - By PHP Expert


final methods
The final keyword allows you to mark methods so that an inheriting class can't overload them.

class MyClass {
final function getBaseClassName() {
return __CLASS__;
}
}

final classes
After declaring a class as final, it can't be inherited. The following example would error out:

final class FinalClass {
}

class BogusClass extends FinalClass {
}

No comments

Enter your email address:

Delivered by FeedBurner

OR

 Subscribe in a reader