class Foo {
private $_bar;
public function getBar() {
return $this->_bar;
}
}
$b = new Foo();
$b->xxx(); //xxx is an udefined method.
How to enhance the following class to throw a notice if undefined methods is called?
class Foo {
private $_bar;
public function getBar() {
return $this->_bar;
}
}
$b = new Foo();
$b->xxx(); //xxx is an udefined method.
How to enhance the following class to throw a notice if undefined methods is called?
A PHP warning would be thrown like any other time when you call an undefined function. You need to enable it with error_reporting(E_ALL);.
write __call in Class Foo
function __call( $functionName, $argumentsArray ) {
echo "Function $functionName does not exist";
}