What is the output when the following code is executed? <?php function myFun($a) { if (!$a) { throw new Exception('Value init.'); } return 3/$a; } try { echo myFun(3) . "\n"; } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } finally { echo "first\n"; } try { echo myFun(1) . "\n"; } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } finally { echo "second\n"; } echo "Hello PHP Example\n"; ?>
Correct Answer: 1 first 3 second Hello PHP Example
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More PHP MCQ Questions