In the example code:
<?php
for ($i = 1; $i <=20; $i++) {
echo $i . '<br />';
if ($i == 10) {
$haha->hoho("hehe");
}
}
?>
When $i = 10 program will show this error, Call to a member function hoho() on a non-object because $haha is not a object and the program stops running. I want the program to handle this error and continue running to $i=20. How can I do it?