blob: 06bd534a3bc14adb84286058b4a57dc1d89afca3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<?php
/**
* exception.cpp
*
* @author Jasper van Eck <jasper.vaneck@copernica.com>
*
* This example shows the working of a C++ function that throws an
* exception, and that exception is then caught by PHP code.
*
*/
// call the second C++ function that accepts a callback
my_catch_exception_function(function($a, $b, $c) {
// throw an exception from PHP - the C++ code will catch this exception
throw new Exception("Example exception");
});}
|