<?php
function divide($numerator, $denominator) {
    try {
        if ($denominator === 0) {
            throw new Exception("<br>Cannot divide by zero!");
        }
        $result = $numerator / $denominator;
        echo "Result: ". $result. "<br><br";
    } catch (Exception $e) {
        echo "Exception caught: ". $e->getMessage() . "<br>";
        // Optionally rethrow the exception
        // throw $e;
    } finally {
        echo "Finally block executed.<br>";
    }
}

// Example usage
divide(10, 2);
divide(5, 0);
divide(8, 4);
?>