summaryrefslogtreecommitdiff
path: root/documentation
diff options
context:
space:
mode:
Diffstat (limited to 'documentation')
-rw-r--r--documentation/exceptions.html19
1 files changed, 13 insertions, 6 deletions
diff --git a/documentation/exceptions.html b/documentation/exceptions.html
index 1af4913..88af60f 100644
--- a/documentation/exceptions.html
+++ b/documentation/exceptions.html
@@ -126,15 +126,22 @@ extern "C" {
<?php
// call "callMe" for the first time, and supply a function that returns "first call"
-echo(callMe(function() {
- return "first call\n";
-}));
+$output = callMe(function() {
+ return "First call";
+});
+
+// show output (this will be "First call")
+echo("$output\n");
// call "callMe" for the second time, but throw an exception this time
-echo(callMe(function() {
+$output = callMe(function() {
throw new Exception("Sorry...\n");
- return "second call\n";
-}));
+ return "Second call\n";
+});
+
+// show output (this will be "Exception caught")
+echo("$output\n");
+
?>
</code></pre>
</p>