This is an example using ReflectionMethod() to check if the parent class method is abstract or not. Calling an abstract method of a parent class will crash PHP.
<?php
abstract class modProcessor {
abstract public function process();
}
class ConcreteClass extends modProcessor {
public function process() {
$reflectionMethod = new ReflectionMethod('modProcessor', 'process');
if (! $reflectionMethod->isAbstract()) {
parent::process();
} else {
echo "Cannot call abstract parent method";
}
}
}
$c = new ConcreteClass($modx);
$c->process();