It would be hard to emulate an interface with PHP 4. Abstract classes, however, can be simulated. Define a base class, and ensure that every "abstract" method contains a die() statement:
function doThing() {
die( "doThing() is abstract and must be overridden" );
}
This is clearly not as satisfactory as PHP 5's abstract classes, but it can be deployed quite effectively nevertheless.
|