class MyClass {
public function __construct(){
}
private function makeError(){
return sp('ABC'); // sp is undefined function
}
private function printMe(){
echo "PRINT ME";
}
public function run(){
try {
$t = $this->makeError();
}catch(Exception $e){
}
$this->printMe();
}
}
$t = new MyClass();
$t->run();
If run above code, an error occur because sp() is not defined function.
But I'd like to ignore the error and run printMe method.
How should I do?
Thanks!