summaryrefslogtreecommitdiff
path: root/Examples/Exceptions/ExceptionCatch/exception.php
blob: 0fec704019416f2871023be193fdedfe6ba49c15 (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");
});}