summaryrefslogtreecommitdiff
path: root/Examples/Exceptions/exception.php
blob: b288e233216d26cf21bc5719353331978e166cc6 (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
26
<?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();
	
}
	echo my_throw_exception_function() . "\n";