Using the __call() Method
<?php
class ParentClass {
function __call($method, $params) {
echo "The method $method doesn't exist!\n";
}
}
class ChildClass extends ParentClass {
function myFunction() {
}
}
$inst = new ChildClass();
$inst->nonExistentFunction();
?>
Related examples in the same category