<html>
<body>
try {
$rand = rand(0, 2);
switch($rand) {
case 0: throw new Exception();
case 1: throw new OutOfBoundsException();
case 2: throw new LogicException();
}
} catch(OutOfBoundsException $e) {
echo "Caught an out of bounds exception";
} catch(LogicException $e) {
echo "Caught a logic exception";
} catch(Exception $e) {
echo "Caught an ordinary exception";
}
</body>
</html>