diff options
author | JasperVanEck <jaspergkurtz@gmail.com> | 2013-11-28 13:10:01 +0100 |
---|---|---|
committer | JasperVanEck <jaspergkurtz@gmail.com> | 2013-11-28 13:10:01 +0100 |
commit | bf6bbfae81f24045cd74ae28368931b8a9b3ea97 (patch) | |
tree | 17b9c7c5e08ed10c6ac298c6062f1d5ae2b91f2a /Examples/FunctionWithParameters/functionwithparameters.php | |
parent | 0fdfc4ced15ed29c407ad95cb0e1224711c1919d (diff) |
New Examples added, functionreturnvalue, functionnoparameters and functionwithparameters
Diffstat (limited to 'Examples/FunctionWithParameters/functionwithparameters.php')
-rw-r--r-- | Examples/FunctionWithParameters/functionwithparameters.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Examples/FunctionWithParameters/functionwithparameters.php b/Examples/FunctionWithParameters/functionwithparameters.php new file mode 100644 index 0000000..04a0cb6 --- /dev/null +++ b/Examples/FunctionWithParameters/functionwithparameters.php @@ -0,0 +1,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'; |