summaryrefslogtreecommitdiff
path: root/Examples/Exceptions/exception.php
blob: 9c02286b2438e92ac2eadc4eb1b872307ee33074 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/*
 *	exception.cpp
 * 	@author Jasper van Eck<jasper.vaneck@copernica.com>
 * 
 * 	An example file to show the working of a function which throws an exception.
 * 	
 * 	Exceptions haven't been implemented yet. 
 * 	Therefore this example is not yet a working one.
 */

/*
 *	Run a function which throws an exception.
 */

try
{
	echo "Function which throws an exception; my_throw_exception_function()\n";
	echo my_throw_exception_function() . "\n";
}
catch (Exception $exception)
{
	echo $exception->getMessage(). "\n";
	
}