Simple error handling/catching/avoidance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just wondering why the following code actually renders an error message instead of just then invoking the catch clause:

//start code
$iVar1 = 0;
$iVar2 = 10;
try {
echo $iVar2 / $iVar1;
} catch (Exception $e) {
echo "No division by zero allowed";
}
//end of code

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux