summaryrefslogtreecommitdiff
path: root/Examples/FunctionWithParameters/functionwithparameters.php
blob: 04a0cb6e01949222eeae62ff34e89ac765b88e7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
/*
 *	functionwithparameters.php
 * 	@Author Jasper van Eck
 * 
 * 	An example file to show the working of a function call with parameters, defined and undefined.
 */

/*
 *	Run a function with parameters. 
 */
echo 'A function which takes parameters, which are all undefined;' . 
	'\nmy_with_undefined_parameters_function("1st","2nd","3rd","4th")\n';
echo my_with_undefined_parameters_function("1st","2nd","3rd","4th") . '\n';

echo 'A function which takes parameters, which are all defined;' . 
	'\nmy_with_defined_parameters_function(21,42)\n';
echo my_with_defined_parameters_function(21,42) . '\n';

echo 'Accessing a non-existant parameters index will result in a segmentation fault.\n';
echo 'The segmentation fault will also occur when passing the wrong type of parameter.\n';